nixos-config/modules/system/services/alloy.nix

32 lines
645 B
Nix

{ 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=127.0.0.1:${builtins.toString cfg.port}"
"--disable-reporting"
];
};
};
}