diff --git a/modules/system/services/alloy.nix b/modules/system/services/alloy.nix new file mode 100644 index 0000000..784a605 --- /dev/null +++ b/modules/system/services/alloy.nix @@ -0,0 +1,32 @@ +{ 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.list = [ cfg.port ]; + }; + + services.alloy = { + enable = true; + extraFlags = [ + "--server.http.listen-addr=127.0.0.1:${builtins.toString cfg.port}" + "--disable-reporting" + ]; + }; + }; +}