aboutsummaryrefslogtreecommitdiff
path: root/www/index.nix
diff options
context:
space:
mode:
Diffstat (limited to 'www/index.nix')
-rw-r--r--www/index.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/www/index.nix b/www/index.nix
new file mode 100644
index 0000000..0d84ec3
--- /dev/null
+++ b/www/index.nix
@@ -0,0 +1,33 @@
+{ self, ... }:
+{
+ perSystem =
+ { ... }:
+ {
+ websites.${self.domain} =
+ { config, lib, ... }:
+ let
+ inherit (lib) mkOption types;
+ replacements = {
+ "@title@" = config.title;
+ };
+ replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file;
+ in
+ {
+ files =
+ with lib;
+ listToAttrs (
+ map
+ (path: rec {
+ name = baseNameOf path;
+ value = with builtins; toFile "index.html" (replace (readFile path));
+ })
+ [
+ ./html/index.html
+ ./html/vergangene-termine.html
+ ./html/impressum.html
+ ./html/datenschutz.html
+ ]
+ );
+ };
+ };
+}