fix: better handling of domain
This commit is contained in:
parent
6e58eac8c1
commit
ad2c9dad6b
1 changed files with 12 additions and 5 deletions
|
@ -30,9 +30,16 @@ Gonna use a priper nixos module for this
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
subdomain = mkOption {
|
domain = {
|
||||||
type = types.str;
|
base = mkOption {
|
||||||
default = "sso";
|
type = types.str;
|
||||||
|
default = "skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
|
sub = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "sso";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
frontend.port = mkOption {
|
frontend.port = mkOption {
|
||||||
|
@ -65,7 +72,7 @@ Gonna use a priper nixos module for this
|
||||||
};
|
};
|
||||||
|
|
||||||
skynet_dns.records.cname = [
|
skynet_dns.records.cname = [
|
||||||
"${cfg.subdomain} CNAME ${cfg.host.name}"
|
"${cfg.domain.sub} CNAME ${cfg.host.name}"
|
||||||
];
|
];
|
||||||
|
|
||||||
# firewall on teh computer itself
|
# firewall on teh computer itself
|
||||||
|
@ -154,7 +161,7 @@ Gonna use a priper nixos module for this
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."${cfg.subdomain}.skynet.ie" = {
|
services.nginx.virtualHosts."${cfg.domain.sub}.${cfg.domain.base}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "skynet";
|
||||||
locations."/".proxyPass = "http://localhost:${cfg.frontend.port}";
|
locations."/".proxyPass = "http://localhost:${cfg.frontend.port}";
|
||||||
|
|
Loading…
Reference in a new issue