summary refs log tree commit diff
path: root/nixos/modules/services/printing
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-09-09 04:42:19 -0400
committerGitHub <noreply@github.com>2019-09-09 04:42:19 -0400
commit787eabd7c122ffbf1343499aa8e9c4cb7a68a519 (patch)
treece6ae551eedb59e0ddac1112827dc7890c7da4eb /nixos/modules/services/printing
parentc8c04bc96ce799f0ef10239e521f52c749c1a70a (diff)
parentb9d9045d5745fec640fb8261f9bdf2512eb372bd (diff)
downloadnixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar
nixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.gz
nixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.bz2
nixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.lz
nixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.xz
nixpkgs-787eabd7c122ffbf1343499aa8e9c4cb7a68a519.tar.zst
nixpkgs-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/printing')
-rw-r--r--nixos/modules/services/printing/cupsd.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix
index 7f1e793b980..3fcae611dc7 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.