nixpkgs/pkgs/desktops/gnome-3/core/gnome-session/fix-paths.patch
Tor Hedin Brønner a43660271b gnome3.gnome-session: always run /etc/set-environment on startup
gnomes-session sources its environment from a login shell. But if the systemd
user environment already contains `__NIXOS_SET_ENVIRONMENT_DONE` the environment
setup won't happen correctly. Simply unset this variable to ensure a fresh
environment.

This was previously handled by a GDM patch, but it no longer works reliably with
gnome-sessions systemd session.

We still need the GDM patch to handle running other sessions (eg. plasma).

See https://github.com/NixOS/nixpkgs/issues/48255 for more info on the
underlying issue.
2019-10-06 07:35:36 +02:00

41 lines
1.3 KiB
Diff

--- a/gnome-session/gnome-session.in
+++ b/gnome-session/gnome-session.in
@@ -3,11 +3,13 @@
if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
[ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
[ -n "$SHELL" ] &&
- grep -q "$SHELL" /etc/shells &&
- ! (echo "$SHELL" | grep -q "false") &&
- ! (echo "$SHELL" | grep -q "nologin"); then
+ @grep@ -q "$SHELL" /etc/shells &&
+ ! (echo "$SHELL" | @grep@ -q "false") &&
+ ! (echo "$SHELL" | @grep@ -q "nologin"); then
if [ "$1" != '-l' ]; then
- exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
+ # Make sure the shell actually sets up the environment
+ unset __NIXOS_SET_ENVIRONMENT_DONE
+ exec @bash@ -c "exec -l '$SHELL' -c '$0 -l $*'"
else
shift
fi
@@ -13,7 +13,7 @@
fi
fi
-SETTING=$(G_MESSAGES_DEBUG= gsettings get org.gnome.system.locale region)
+SETTING=$(G_MESSAGES_DEBUG= @gsettings@ get org.gnome.system.locale region)
REGION=${SETTING#\'}
REGION=${REGION%\'}
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -203,7 +203,7 @@
}
new_argv[i + 2] = NULL;
- if (!execvp ("dbus-launch", new_argv)) {
+ if (!execvp ("@dbusLaunch@", new_argv)) {
g_set_error (error,
G_SPAWN_ERROR,
G_SPAWN_ERROR_FAILED,