nixos/ups: install udev rules for nut

This is necessary to allow the usbhid driver to successfully send
commands to the attached UPS.

It is possible to work around this by explicitly using setting the user
flag (e.g. `upsdrvctl -u root shutdown`), though it is much simpler to
install the udev rules rather than patch things further.
This commit is contained in:
Ivan Petkov 2023-12-10 11:23:37 -08:00
parent 7d9956755e
commit fc004b09e5
No known key found for this signature in database
GPG key ID: BB6F9EFC065832B6
2 changed files with 4 additions and 0 deletions

View file

@ -590,6 +590,7 @@ in
"d /var/lib/nut 700"
];
services.udev.packages = [ pkgs.nut ];
/*
users.users.nut =

View file

@ -85,6 +85,9 @@ stdenv.mkDerivation rec {
# we don't need init.d scripts
rm -r $out/share/solaris-init
# Suspicious/overly broad rule, remove it until we know better
rm $out/etc/udev/rules.d/52-nut-ipmipsu.rules
'';
meta = with lib; {