From 6a2999310e4f5d4bfdec15d1aed54f98096fba9d Mon Sep 17 00:00:00 2001 From: Paul Stadig Date: Thu, 27 Jul 2023 06:12:34 -0400 Subject: [PATCH] xfce.xfce4-power-manager: use fixed path for helpers Using a nix store path for `xfpm-power-backlight-helper` and `xfce4-pm-helper` causes permission errors after a rebuild when adjusting brightness or putting the system to sleep, because the permitted executables are different from the ones `xfce4-power-manager` wants to execute. Using a fixed path (/run/current-system/sw/bin) means the paths do not change after a rebuild, so there's no permission error. A similar approach is taken with gnome's `gsd-backlight-helper`. Fixes #77485 --- pkgs/desktops/xfce/core/xfce4-power-manager/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix b/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix index 8755234cbc82..19b552937119 100644 --- a/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix +++ b/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix @@ -26,6 +26,14 @@ mkXfceDerivation { xfce4-panel ]; + # using /run/current-system/sw/bin instead of nix store path prevents polkit permission errors on + # rebuild. See https://github.com/NixOS/nixpkgs/issues/77485 + postPatch = '' + substituteInPlace src/org.xfce.power.policy.in2 --replace "@sbindir@" "/run/current-system/sw/bin" + substituteInPlace common/xfpm-brightness.c --replace "SBINDIR" "\"/run/current-system/sw/bin\"" + substituteInPlace src/xfpm-suspend.c --replace "SBINDIR" "\"/run/current-system/sw/bin\"" + ''; + meta = with lib; { description = "A power manager for the Xfce Desktop Environment"; maintainers = with maintainers; [ ] ++ teams.xfce.members;