{ self, pkgs, ... }: let inherit (pkgs.stdenv.hostPlatform) system; in { /** Creates an Anubis instance for this service # Example ```nix mkAnubisInstance "service-a" false ``` # Type ``` mkAnubisInstance :: String -> Bool -> AttrSet ``` # Arguments - [service] The service name that this instance will be proxying - [customPolicy] Whether the service uses a custom `${service}.yaml` policy file. If false, uses `default.yaml` */ mkAnubisInstance = service: customPolicy: let serviceData = self.data.services.${service}; policyFile = if customPolicy then "${service}.yaml" else "default.yaml"; in { settings = { BIND = ":${toString serviceData.anubis}"; POLICY_FNAME = "${self.packages.${system}.anubis-files}/policies/${policyFile}"; TARGET = "http://localhost:${toString serviceData.port}"; }; }; }