static-webserver: Add optional imprint
This commit is contained in:
parent
9e545950f5
commit
e48f367afd
|
@ -27,6 +27,13 @@ in
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
imprint = {
|
||||||
|
enable = lib.mkEnableOption "a location making the imprint available";
|
||||||
|
location = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/imprint/";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -55,11 +62,16 @@ in
|
||||||
(lib.mapAttrsToList
|
(lib.mapAttrsToList
|
||||||
(primaryDomain: vhostCfg:
|
(primaryDomain: vhostCfg:
|
||||||
({
|
({
|
||||||
${primaryDomain} = {
|
${primaryDomain} = lib.mkMerge [
|
||||||
enableACME = true;
|
{
|
||||||
forceSSL = true;
|
enableACME = true;
|
||||||
root = vhostCfg.root;
|
forceSSL = true;
|
||||||
};
|
root = vhostCfg.root;
|
||||||
|
}
|
||||||
|
(lib.mkIf vhostCfg.imprint.enable {
|
||||||
|
locations.${vhostCfg.imprint.location}.alias = "${pkgs.sbruder.imprint}/";
|
||||||
|
})
|
||||||
|
];
|
||||||
} // (lib.listToAttrs (map
|
} // (lib.listToAttrs (map
|
||||||
(domain: lib.nameValuePair domain {
|
(domain: lib.nameValuePair domain {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
Loading…
Reference in a new issue