{ config, lib, ... }: let cfg = config.custom.services.alloy; in { options.custom.services.alloy = { enable = lib.mkEnableOption ""; domain = lib.mkOption { type = lib.types.nonEmptyStr; default = ""; }; port = lib.mkOption { type = lib.types.port; default = 12345; }; }; config = lib.mkIf cfg.enable { meta = { domains.list = [ cfg.domain ]; ports.tcp.list = [ cfg.port ]; }; services.alloy = { enable = true; extraFlags = [ "--server.http.listen-addr=localhost:${builtins.toString cfg.port}" "--disable-reporting" ]; }; }; }