fix: better handling of domain

This commit is contained in:
silver 2023-05-21 12:08:26 +01:00
parent 6e58eac8c1
commit ad2c9dad6b

View file

@ -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}";