From ab36912ee135d4897730b31d6e767d51bcf54e40 Mon Sep 17 00:00:00 2001 From: Valentin Date: Tue, 16 Dec 2025 21:42:38 +0100 Subject: Titel auf allen Seiten aus Konfiguration generiert --- www/index.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 www/index.nix (limited to 'www/index.nix') 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 + ] + ); + }; + }; +} -- cgit v1.2.3