git.iko.soy/typeable/nixpkgs
on master help sign in
gnome3.gnome-settings-daemon: fix #14168

The issue in brief is caused by the fact that gnome-settings-daemon is non-restartable and if the policy definitions change in any way it won't propagate to the running system because of that. By patching references to the backlight helper to /run/current-system/sw/bin/gsd-backlight-helper the polkit policy will not undergo a change.

commitf6e92290b371a71aec02483e87f629c7df26aab1 authorworldofpeace <worldofpeace@users.noreply.github.com> dateMon 22 Apr 2019, 15:55 (8 years ago) parenteb60ddb
2 files changed+33
pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix+7 pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patch+26
pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix+7
@@ -50,6 +50,7 @@ stdenv.mkDerivation rec {
5050 src = ./fix-paths.patch;
5151 inherit tzdata;
5252 })
53+ ./global-backlight-helper.patch
5354 ];
5455
5556 nativeBuildInputs = [
@@ -93,6 +94,12 @@ stdenv.mkDerivation rec {
9394 "-Dudev_dir=${placeholder "out"}/lib/udev"
9495 ];
9596
97+ # So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper
98+ postFixup = ''
99+ mkdir -p $out/bin/gnome-settings-daemon
100+ ln -s $out/libexec/gsd-backlight-helper $out/bin/gnome-settings-daemon/gsd-backlight-helper
101+ '';
102+
96103 postPatch = ''
97104 for f in gnome-settings-daemon/codegen.py plugins/power/gsd-power-constants-update.pl meson_post_install.py; do
98105 chmod +x $f
pkgs/desktops/gnome-3/core/gnome-settings-daemon/global-backlight-helper.patchnew file+26
@@ -0,0 +1,26 @@
1+diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c
2+index d7d10fd2..5619d6ad 100644
3+--- a/plugins/power/gsd-backlight.c
4++++ b/plugins/power/gsd-backlight.c
5+@@ -358,7 +358,7 @@ gsd_backlight_run_set_helper (GsdBacklight *backlight, GTask *task)
6+ proc = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_SILENCE,
7+ &error,
8+ "pkexec",
9+- LIBEXECDIR "/gsd-backlight-helper",
10++ "/run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper",
11+ g_udev_device_get_sysfs_path (backlight->udev_device),
12+ data->value_str, NULL);
13+ } else {
14+diff --git a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
15+index f16300f8..79d6bd17 100644
16+--- a/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
17++++ b/plugins/power/org.gnome.settings-daemon.plugins.power.policy.in.in
18+@@ -25,7 +25,7 @@
19+ <allow_inactive>no</allow_inactive>
20+ <allow_active>yes</allow_active>
21+ </defaults>
22+- <annotate key="org.freedesktop.policykit.exec.path">@libexecdir@/gsd-backlight-helper</annotate>
23++ <annotate key="org.freedesktop.policykit.exec.path">/run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper</annotate>
24+ </action>
25+
26+ </policyconfig>