rexxar: make prometheus-ipmi-exporter work when launched from systemd

This commit is contained in:
Luke Granger-Brown 2024-11-24 13:00:05 +00:00
parent cf619ce7f6
commit 16324cdcf8
2 changed files with 15 additions and 0 deletions

View file

@ -423,7 +423,16 @@
hardware.rasdaemon.enable = true; hardware.rasdaemon.enable = true;
services.prometheus.exporters.ipmi = { services.prometheus.exporters.ipmi = {
enable = true; enable = true;
group = "ipmi";
}; };
users.groups.ipmi = {};
systemd.services.prometheus-ipmi-exporter.serviceConfig = {
DeviceAllow = lib.mkAfter [ "/dev/ipmi0 rw" ];
BindPaths = lib.mkAfter [ "/dev/ipmi0" ];
};
services.udev.extraRules = lib.mkAfter ''
KERNEL=="ipmi*", MODE="660", GROUP="ipmi"
'';
my.services.seaweedfs = { my.services.seaweedfs = {
securitySettings = { securitySettings = {

View file

@ -57,6 +57,12 @@ let
sha256 = "1jdyk6d80jmsg6qn7hw58088yydn78g3kn3lmgg8argihb69pf2i"; sha256 = "1jdyk6d80jmsg6qn7hw58088yydn78g3kn3lmgg8argihb69pf2i";
}; };
}); });
prometheus-ipmi-exporter = pkgs.prometheus-ipmi-exporter.override (old: {
freeipmi = old.freeipmi.overrideAttrs (oldAttrs: {
env.NIX_CFLAGS_COMPILE = "-DIPMI_DONT_CHECK_FOR_ROOT";
enableParallelBuilding = true;
});
});
}; };
}; };
nixpkgs = import ./nixpkgs { nixpkgs = import ./nixpkgs {