https://github.com/head-gardener/alloy
mkMiddleware
forEach
option = alloy.module.forEach (host: { ... })
alloy
arg has a special self
field that
contains this host expanded.
{ config, alloy, ... }: {
alloy.extend.nginx = [{
services.nginx.virtualHosts."web-server" = {
locations."/".proxyPass =
"http://${alloy.self.address}:${toString config.services.web-server.port}";
};
}];
services.web-server.enable = true;
}
{
middleware = alloy-utils.mkMiddleware { ... };
hosts = mods: {
pc = {
modules = [];
region = "home";
};
laptop = {
modules = [];
region = "roaming";
};
};
}