diff --git a/modules/static-webserver.nix b/modules/static-webserver.nix index 0ee1635..805596a 100644 --- a/modules/static-webserver.nix +++ b/modules/static-webserver.nix @@ -27,6 +27,13 @@ in 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 = { }; @@ -55,11 +62,16 @@ in (lib.mapAttrsToList (primaryDomain: vhostCfg: ({ - ${primaryDomain} = { - enableACME = true; - forceSSL = true; - root = vhostCfg.root; - }; + ${primaryDomain} = lib.mkMerge [ + { + enableACME = true; + forceSSL = true; + root = vhostCfg.root; + } + (lib.mkIf vhostCfg.imprint.enable { + locations.${vhostCfg.imprint.location}.alias = "${pkgs.sbruder.imprint}/"; + }) + ]; } // (lib.listToAttrs (map (domain: lib.nameValuePair domain { enableACME = true;