stuff
This commit is contained in:
@@ -29,6 +29,14 @@ let
|
||||
) domains;
|
||||
message = "proxiedService ${proxiedConfig.name}'s `domain` does not match any of the known domains";
|
||||
}) proxied;
|
||||
#networking.hosts = mapListToAttrs (c: lib.nameValuePair c.ipAddress [ c.name ]) proxied;
|
||||
hosts = lib.foldl (acc: c:
|
||||
let
|
||||
name = c.ipAddress;
|
||||
val = c.name;
|
||||
in
|
||||
acc // { ${name} = (acc.${name} or []) ++ [ val ]; }
|
||||
) {} proxied;
|
||||
mapListToAttrs = f: list: lib.listToAttrs (map f list);
|
||||
in
|
||||
{
|
||||
@@ -84,7 +92,7 @@ in
|
||||
users.users.haproxy.extraGroups = [ config.users.groups.acme.name ];
|
||||
services.haproxy.enable = true;
|
||||
services.haproxy.config = import ./haproxy-config.nix { inherit lib domains proxied; };
|
||||
networking.hosts = mapListToAttrs (c: lib.nameValuePair c.ipAddress [ c.name ]) proxied;
|
||||
networking.hosts = hosts;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user