diff --git a/flake.nix b/flake.nix index 8be0273..280ad0b 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ]; }; diff --git a/modules/prometheus.nix b/modules/prometheus.nix new file mode 100644 index 0000000..1cd229c --- /dev/null +++ b/modules/prometheus.nix @@ -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; + }; + }; + }; + }; +}