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
|
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 {
|
stateDir = mkOption {
|
||||||
default = "/var/lib/strojnadzor";
|
default = "/var/lib/strojnadzor";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
|
@ -90,8 +100,8 @@ in
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"golovizin.ru" = {
|
"${cfg.hostName}" = {
|
||||||
serverAliases = [ "www.golovizin.ru" "xn--b1abndboscb.xn--p1ai" "www.xn--b1abndboscb.xn--p1ai" ];
|
serverAliases = cfg.hostNameAliases;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
extraConfig = hsts + ''
|
extraConfig = hsts + ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue