diff --git a/modules/proxy-suite/default.nix b/modules/proxy-suite/default.nix index a319e63..b20982c 100644 --- a/modules/proxy-suite/default.nix +++ b/modules/proxy-suite/default.nix @@ -10,6 +10,7 @@ { config, + options, lib, pkgs, ... @@ -84,6 +85,7 @@ in (import ./service { inherit config + options lib pkgs packages diff --git a/modules/proxy-suite/service/default.nix b/modules/proxy-suite/service/default.nix index 19ef96c..6606767 100644 --- a/modules/proxy-suite/service/default.nix +++ b/modules/proxy-suite/service/default.nix @@ -1,6 +1,7 @@ # Assembles proxy-suite systemd services from the sub-modules. { config, + options, lib, pkgs, packages, @@ -136,6 +137,11 @@ let in lib.mkMerge [ autoProxyUnits + # The GUI's pkexec needs its setuid wrapper, off by default since nixpkgs 26.11 (and + # always there before, where the option does not exist). + (lib.optionalAttrs (options.security.polkit ? enablePkexecWrapper) { + security.polkit.enablePkexecWrapper = lib.mkIf (cfg.enable && cfg.gui.enable) true; + }) { # See constants.serviceUser. users.users.${constants.serviceUser} = { diff --git a/nix/checks/gui.nix b/nix/checks/gui.nix index b4a75cf..e738525 100644 --- a/nix/checks/gui.nix +++ b/nix/checks/gui.nix @@ -66,6 +66,8 @@ in rules = guiFixture.config.security.polkit.extraConfig; in assert guiFixture.config.security.polkit.enable; + # nixpkgs 26.11+: no setuid pkexec unless asked for, and without it pkexec refuses to run. + assert guiFixture.config.security.wrappers ? pkexec && guiFixture.config.security.wrappers.pkexec.enable; assert builtins.match ''.*action\.lookup\("program"\) === "/nix/store/[^"]*proxy-ctl/bin/proxy-ctl".*AUTH_ADMIN_KEEP.*'' rules != null;