{ self, ... }:
{
perSystem =
{ ... }:
{
websites.${self.domain} =
{ config, lib, ... }:
let
inherit (lib) mkOption types;
root = ./html;
files =
with lib.fileset;
toList (difference (fileFilter (file: file.hasExt "html") root) ./html/Kalender);
replacements = {
"@title@" = config.title;
"@stylesheet@" = '''';
"@head@" = ''
'';
};
replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file;
in
{
title = "Stadtteilbeirat Heimfeld";
files =
with lib;
listToAttrs (
map (path: {
name = lib.path.removePrefix root path;
value = with builtins; toFile (baseNameOf path) (replace (readFile path));
}) files
);
};
};
}