From 602e14fc8bc7d7acc5b99687de2ecc7d23da4201 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Wed, 6 Nov 2019 15:05:22 -0500 Subject: [PATCH 1/2] gnome3.gnome-flashback: add systemd targets for customSessions --- pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix b/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix index e381860ca2c9..dc7e0ed222f0 100644 --- a/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix +++ b/pkgs/desktops/gnome-3/misc/gnome-flashback/default.nix @@ -22,6 +22,7 @@ , writeTextFile , writeShellScriptBin , xkeyboard_config +, runCommand }: let @@ -141,6 +142,13 @@ let DesktopNames=GNOME-Flashback;GNOME; ''; }; + + mkSystemdTargetForWm = { wmName }: + runCommand "gnome-flashback-${wmName}.target" {} '' + mkdir -p $out/lib/systemd/user + cp "${gnome-flashback}/lib/systemd/user/gnome-session-x11@gnome-flashback-metacity.target" \ + "$out/lib/systemd/user/gnome-session-x11@gnome-flashback-${wmName}.target" + ''; }; meta = with stdenv.lib; { From 473cd0d4ba97a579b473c37022a5809af3b6b76f Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Wed, 6 Nov 2019 15:14:25 -0500 Subject: [PATCH 2/2] nixos/gnome3: add gnome-flashback to systemd.packages When we did the revert of adding gnome-flashback to systemd.packages [0] I forgot to test with other display managers. If we use GDM with gnome-flashback it appears it doesn't try to fallback to non-systemd startup and always fails and starts the regular gnome-session. So adding gnome-flashback to systemd.packages was perfectly fine, but we did forgot one detail. We need systemd targets for the customSessions which is added using mkSystemdTargetForWm in the gnome- flashback package. [0]: 42f567b30def552337bf17a6d30410c16c2b47cc --- nixos/modules/services/x11/desktop-managers/gnome3.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 5ad31e5b9d00..7338319f1115 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -184,6 +184,13 @@ in enableGnomeKeyring = true; }; + systemd.packages = with pkgs.gnome3; [ + gnome-flashback + ] ++ (map + (wm: gnome-flashback.mkSystemdTargetForWm { + inherit (wm) wmName; + }) cfg.flashback.customSessions); + services.dbus.packages = [ pkgs.gnome3.gnome-screensaver ];