Prometheus module

This commit is contained in:
Nox Sluijtman 2023-12-30 16:34:24 +01:00
parent d5b606de09
commit 6df439251f
2 changed files with 24 additions and 2 deletions

View file

@ -3,7 +3,7 @@
outputs = _: {
nixosModules = {
default = {
everything = {
imports = [
./modules/audio.nix
@ -14,14 +14,16 @@
./modules/vim.nix
./modules/xconfig.nix
./modules/zsh.nix
./modules/prometheus.nix
];
};
live = {
server = {
imports = [
./modules/vim.nix
./modules/zsh.nix
./modules/prometheus.nix
];
};

20
modules/prometheus.nix Normal file
View file

@ -0,0 +1,20 @@
{ lib, config, ... }:
with lib;
let cfg = config.voidcruiser.prometheus;
in {
options.voidcruiser.prometheus = {
enable = mkEnableOption "Enable prometheus node";
};
config = mkIf cfg.enable {
services.prometheus = {
enable = true;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" "cpu" ];
port = 9002;
};
};
};
};
}