about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/desktops/xfce/core/xfce4-power-manager/default.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix b/pkgs/desktops/xfce/core/xfce4-power-manager/default.nix
index 8755234cbc827..19b552937119d 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;