alloy

https://github.com/head-gardener/alloy

TODO

Interface notes

forEach

option = alloy.module.forEach (host: { ... })

Self

alloy arg has a special self field that contains this host expanded.

Remote extend

{ 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

{
  middleware = alloy-utils.mkMiddleware { ... };
  hosts = mods: {
    pc = {
      modules = [];
      region = "home";
    };
    laptop = {
      modules = [];
      region = "roaming";
    };
  };
}