Move site hostnames into options
This commit is contained in:
parent
00decb5f92
commit
1429212c4a
1 changed files with 12 additions and 2 deletions
14
module.nix
14
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 + ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue