From e5f495b69b9aa4a5710ae6917922cf400a54ee9f Mon Sep 17 00:00:00 2001 From: Jack Kelly Date: Fri, 14 Aug 2026 11:10:23 -0400 Subject: [PATCH] nixos/ups: run killpower driver as root upsdrv starts the driver with `upsdrvctl -u root start`, but ups-killpower invokes a bare `upsdrvctl shutdown`. Since nut is built --with-user=nutmon, nut fails to read both /var/lib/nut and the USB device with "insufficient permissions on everything". The UPS is then never told to cut its outlets: it keeps draining battery after the OS has halted, and cannot power-cycle the machine when mains returns. Ergo, run the shutdown as root. (cherry picked from commit f4d444ddff6304b489b9ad9a56e9f81f405a4b02) --- nixos/modules/services/monitoring/ups.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/ups.nix b/nixos/modules/services/monitoring/ups.nix index 7ca9a63d95af..24d013c642e2 100644 --- a/nixos/modules/services/monitoring/ups.nix +++ b/nixos/modules/services/monitoring/ups.nix @@ -679,7 +679,7 @@ in environment = envVars; serviceConfig = { Type = "oneshot"; - ExecStart = "${cfg.package}/bin/upsdrvctl shutdown"; + ExecStart = "${cfg.package}/bin/upsdrvctl -u root shutdown"; }; };