fix: pkexec wrapper
This commit is contained in:
3 files changed
+10
No files matched your search
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
options,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
@@ -84,6 +85,7 @@ in
|
|||||||
(import ./service {
|
(import ./service {
|
||||||
inherit
|
inherit
|
||||||
config
|
config
|
||||||
|
options
|
||||||
lib
|
lib
|
||||||
pkgs
|
pkgs
|
||||||
packages
|
packages
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# Assembles proxy-suite systemd services from the sub-modules.
|
# Assembles proxy-suite systemd services from the sub-modules.
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
options,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
packages,
|
packages,
|
||||||
@@ -136,6 +137,11 @@ let
|
|||||||
in
|
in
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
autoProxyUnits
|
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.
|
# See constants.serviceUser.
|
||||||
users.users.${constants.serviceUser} = {
|
users.users.${constants.serviceUser} = {
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ in
|
|||||||
rules = guiFixture.config.security.polkit.extraConfig;
|
rules = guiFixture.config.security.polkit.extraConfig;
|
||||||
in
|
in
|
||||||
assert guiFixture.config.security.polkit.enable;
|
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
|
assert
|
||||||
builtins.match ''.*action\.lookup\("program"\) === "/nix/store/[^"]*proxy-ctl/bin/proxy-ctl".*AUTH_ADMIN_KEEP.*'' rules
|
builtins.match ''.*action\.lookup\("program"\) === "/nix/store/[^"]*proxy-ctl/bin/proxy-ctl".*AUTH_ADMIN_KEEP.*'' rules
|
||||||
!= null;
|
!= null;
|
||||||
|
|||||||
Reference in new issue
Block a user