From ad2c9dad6bc7f964ceae65ed3b8fba3e1967c7d3 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 21 May 2023 12:08:26 +0100 Subject: [PATCH] fix: better handling of domain --- applications/ldap.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/applications/ldap.nix b/applications/ldap.nix index 78cdb6e..b42d9e3 100644 --- a/applications/ldap.nix +++ b/applications/ldap.nix @@ -30,9 +30,16 @@ Gonna use a priper nixos module for this }; }; - subdomain = mkOption { - type = types.str; - default = "sso"; + domain = { + base = mkOption { + type = types.str; + default = "skynet.ie"; + }; + + sub = mkOption { + type = types.str; + default = "sso"; + }; }; frontend.port = mkOption { @@ -65,7 +72,7 @@ Gonna use a priper nixos module for this }; skynet_dns.records.cname = [ - "${cfg.subdomain} CNAME ${cfg.host.name}" + "${cfg.domain.sub} CNAME ${cfg.host.name}" ]; # 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; useACMEHost = "skynet"; locations."/".proxyPass = "http://localhost:${cfg.frontend.port}";