diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2019-09-09 04:42:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 04:42:19 -0400 |
commit | 787eabd7c122ffbf1343499aa8e9c4cb7a68a519 (patch) | |
tree | ce6ae551eedb59e0ddac1112827dc7890c7da4eb /nixos/modules/services | |
parent | c8c04bc96ce799f0ef10239e521f52c749c1a70a (diff) | |
parent | b9d9045d5745fec640fb8261f9bdf2512eb372bd (diff) | |
download | nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.gz nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.bz2 nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.lz nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.xz nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.zst nixlib-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.zip |
Merge pull request #68218 from worldofpeace/cups-pk/no-auth-wheel
nixos/cupsd: passwordless admin for wheel with polkit
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/printing/cupsd.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 7f1e793b980e..3fcae611dc79 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -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. |