mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-23 18:58:28 +01:00
Compare commits
4 commits
8855886547
...
3f882c89c7
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f882c89c7 | |||
| 5378dd24ae | |||
| a351615be5 | |||
| 050f635b8f |
2 changed files with 32 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue