diff --git a/module.nix b/module.nix index f0e289e..3825420 100644 --- a/module.nix +++ b/module.nix @@ -29,6 +29,16 @@ in Whether to enable Strojnadzor "; }; + hostName = mkOption { + default = "golovizin.ru"; + type = types.str; + description = "Main hostname."; + }; + hostNameAliases = mkOption { + default = [ "www.golovizin.ru" "xn--b1abndboscb.xn--p1ai" "www.xn--b1abndboscb.xn--p1ai" ]; + type = types.listOf types.str; + description = "Additional hostnames."; + }; stateDir = mkOption { default = "/var/lib/strojnadzor"; type = types.str; @@ -90,8 +100,8 @@ in services.nginx = { enable = true; virtualHosts = { - "golovizin.ru" = { - serverAliases = [ "www.golovizin.ru" "xn--b1abndboscb.xn--p1ai" "www.xn--b1abndboscb.xn--p1ai" ]; + "${cfg.hostName}" = { + serverAliases = cfg.hostNameAliases; forceSSL = true; enableACME = true; extraConfig = hsts + ''