From 16324cdcf8975072fbe86b1c5765fc1858c03795 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 24 Nov 2024 13:00:05 +0000 Subject: [PATCH] rexxar: make prometheus-ipmi-exporter work when launched from systemd --- ops/nixos/rexxar/default.nix | 9 +++++++++ third_party/default.nix | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ops/nixos/rexxar/default.nix b/ops/nixos/rexxar/default.nix index 6d10dbad94..498f38caa8 100644 --- a/ops/nixos/rexxar/default.nix +++ b/ops/nixos/rexxar/default.nix @@ -423,7 +423,16 @@ hardware.rasdaemon.enable = true; services.prometheus.exporters.ipmi = { 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 = { securitySettings = { diff --git a/third_party/default.nix b/third_party/default.nix index df5a6ccc6e..c8d493dba6 100644 --- a/third_party/default.nix +++ b/third_party/default.nix @@ -57,6 +57,12 @@ let 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 {