Unverified Commit fc004b09 authored by Ivan Petkov's avatar Ivan Petkov
Browse files

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.
parent 7d995675
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -590,6 +590,7 @@ in
      "d /var/lib/nut 700"
    ];

    services.udev.packages = [ pkgs.nut ];

/*
    users.users.nut =
+3 −0
Original line number Diff line number Diff line
@@ -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; {