Compare commits

...

4 commits

2 changed files with 32 additions and 2 deletions

View file

@ -25,6 +25,9 @@ in
caddy = lib.mkEnableOption "" // {
default = config.services.caddy.enable;
};
comin = lib.mkEnableOption "" // {
default = config.services.comin.enable;
};
};
};
@ -109,6 +112,20 @@ in
}
'';
};
"alloy/comin-metrics.alloy" = {
enable = cfg.collect.metrics.comin;
text = ''
prometheus.scrape "comin" {
targets = [{
__address__ = "localhost:${toString config.custom.services.comin.metricsPort}",
job = "comin",
instance = constants.hostname,
}]
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "30s"
}
'';
};
};
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;

View file

@ -4,12 +4,21 @@
lib,
...
}:
let
cfg = config.custom.services.comin;
in
{
imports = [ inputs.comin.nixosModules.comin ];
options.custom.services.comin.enable = lib.mkEnableOption "";
options.custom.services.comin = {
enable = lib.mkEnableOption "";
metricsPort = lib.mkOption {
type = lib.types.port;
default = 4243;
};
};
config = lib.mkIf config.custom.services.comin.enable {
config = lib.mkIf cfg.enable {
services.comin = {
enable = true;
remotes = lib.singleton {
@ -17,6 +26,10 @@
url = "https://github.com/SebastianStork/nixos-config.git";
branches.main.name = "deploy";
};
exporter = {
listen_address = "127.0.0.1";
port = cfg.metricsPort;
};
};
};
}