diff --git a/hosts/public-access-proxy/proxy.nix b/hosts/public-access-proxy/proxy.nix index c0f03634..c4eceddc 100644 --- a/hosts/public-access-proxy/proxy.nix +++ b/hosts/public-access-proxy/proxy.nix @@ -97,6 +97,15 @@ in }; config = lib.mkIf cfg.enable { + assertions = [{ + assertion = let + proxyTo = lib.forEach cfg.proxyHosts (x: x.proxyTo.host); + uniqueProxyTo = lib.unique proxyTo; + in + (builtins.length proxyTo) == (builtins.length uniqueProxyTo); + message = "proxyTo must be unique across the list of proxyHosts. Insert your domain you want to proxy to the list of hostNames instead."; + }]; + services.haproxy = { enable = true; config = ''