nixos/cupsd: passwordless admin for wheel with polkit

This commit is contained in:
worldofpeace 2019-09-06 13:51:38 -04:00
parent 5d4890b58d
commit b9d9045d57

View file

@ -291,6 +291,16 @@ in
services.dbus.packages = [ cups.out ] ++ optional polkitEnabled cups-pk-helper;
# Allow asswordless printer admin for members of wheel group
security.polkit.extraConfig = mkIf polkitEnabled ''
polkit.addRule(function(action, subject) {
if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" &&
subject.isInGroup("wheel")){
return polkit.Result.YES;
}
});
'';
# Cups uses libusb to talk to printers, and does not use the
# linux kernel driver. If the driver is not in a black list, it
# gets loaded, and then cups cannot access the printers.