aboutsummaryrefslogtreecommitdiff
path: root/www/index.nix
blob: 0d84ec3fe7b3fa672733037fe5eff360f54a3bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
                ]
            );
        };
    };
}