ctucx.git: nixfiles

ctucx' nixfiles

commit f566f05cca4d062ae2142ad317f37bdf3d2e9722
parent ad33da70f1a1af99956652260af205868b4453f3
Author: Katja (ctucx) <git@ctu.cx>
Date: Fri, 7 Mar 2025 12:51:52 +0100

configurations/nixos/services/prometheus-exporters: set `services.scaphandre.enable` with `lib.mkDefault`
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configurations/nixos/services/prometheus-exporters.nix b/configurations/nixos/services/prometheus-exporters.nix
@@ -20,7 +20,7 @@
       };
 
       scaphandre = {
-        enable        = (if (builtins.elem "intel_rapl_common" config.boot.kernelModules) then true else false);
+        enable        = lib.mkDefault (if (builtins.elem "intel_rapl_common" config.boot.kernelModules) then true else false);
         user          = "root";
         group         = "root";
         listenAddress = "::1";

@@ -35,8 +35,8 @@
         useACMEHost = "${config.networking.fqdn}";
         forceSSL    = true;
         kTLS        = true;
-        locations."/node-exporter".proxyPass       = "http://${toString config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}/metrics";
-        locations."/systemd-exporter".proxyPass    = "http://${toString config.services.prometheus.exporters.systemd.listenAddress}:${toString config.services.prometheus.exporters.systemd.port}/metrics";
+        locations."/node-exporter".proxyPass = "http://${toString config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}/metrics";
+        locations."/systemd-exporter".proxyPass = "http://${toString config.services.prometheus.exporters.systemd.listenAddress}:${toString config.services.prometheus.exporters.systemd.port}/metrics";
         locations."/scaphandre-exporter".proxyPass = lib.mkIf config.services.prometheus.exporters.scaphandre.enable "http://[::1]:${toString config.services.prometheus.exporters.scaphandre.port}/scaphandre-exporter";
       };
     };