aboutsummaryrefslogtreecommitdiff
path: root/www/index.nix
diff options
context:
space:
mode:
authorValentin <valentin@fricklerhandwerk.de>2025-12-16 21:42:38 +0100
committerValentin <valentin@fricklerhandwerk.de>2025-12-20 17:44:07 +0100
commitab36912ee135d4897730b31d6e767d51bcf54e40 (patch)
tree2893de31834abc12f0f4e2fc2148198efe19d43b /www/index.nix
parent1a99a306ae044625e3f89e16d1d6f809ce8c12e0 (diff)
Titel auf allen Seiten aus Konfiguration generiert
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
+ ]
+ );
+ };
+ };
+}