summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-01-25 18:10:46 -0500
committerGitHub <noreply@github.com>2020-01-25 18:10:46 -0500
commit4c813506898a9f03e9b9c9e2f19c0e800a33a542 (patch)
tree36a6efdfb26a4e7653ee94962cbf7764b832e962
parenta30a49ca0b3cac55fcbe2779ccbab12b53d5c371 (diff)
parent966e56cdfbedc8be3dce8c5ea6050ce4d3075103 (diff)
downloadnixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar.gz
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar.bz2
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar.lz
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar.xz
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.tar.zst
nixpkgs-4c813506898a9f03e9b9c9e2f19c0e800a33a542.zip
Merge pull request #78421 from worldofpeace/upstream-session-xfce
nixos/xfce: use sessionPackages
-rw-r--r--nixos/modules/services/x11/desktop-managers/xfce.nix11
-rw-r--r--pkgs/desktops/xfce/core/xfce4-session/default.nix22
2 files changed, 22 insertions, 11 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index a08b1947f65..21f59074f3a 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -127,14 +127,9 @@ in
       "/share/gtksourceview-4.0"
     ];
 
-    services.xserver.desktopManager.session = [{
-      name = "xfce";
-      bgSupport = true;
-      start = ''
-        ${pkgs.runtimeShell} ${pkgs.xfce.xfce4-session.xinitrc} &
-        waitPID=$!
-      '';
-    }];
+    services.xserver.displayManager.sessionPackages = [
+      pkgs.xfce.xfce4-session
+    ];
 
     services.xserver.updateDbusEnvironment = true;
     services.xserver.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
diff --git a/pkgs/desktops/xfce/core/xfce4-session/default.nix b/pkgs/desktops/xfce/core/xfce4-session/default.nix
index 0ab362aa21d..f97c07156c5 100644
--- a/pkgs/desktops/xfce/core/xfce4-session/default.nix
+++ b/pkgs/desktops/xfce/core/xfce4-session/default.nix
@@ -1,4 +1,4 @@
-{ mkXfceDerivation, polkit, exo, libxfce4util, libxfce4ui, xfconf, iceauth, gtk3, glib, libwnck3, xorg, xfce4-session }:
+{ mkXfceDerivation, polkit, exo, libxfce4util, libxfce4ui, xfconf, iceauth, gtk3, glib, libwnck3, xorg, xfce4-session, runtimeShell }:
 
 mkXfceDerivation {
   category = "xfce";
@@ -14,9 +14,25 @@ mkXfceDerivation {
   # See https://github.com/NixOS/nixpkgs/issues/36468
   NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
 
-  passthru.xinitrc = "${xfce4-session}/etc/xdg/xfce4/xinitrc";
+  # Don't use startxfce4 in xfce.desktop
+  # It's has FHS isms
+  postFixup = ''
+    chmod +x $out/etc/xdg/xfce4/xinitrc
+    patchShebangs $out/etc/xdg/xfce4/xinitrc
 
-  meta =  {
+    substituteInPlace "$out/share/xsessions/xfce.desktop" \
+      --replace "Exec=startxfce4" "Exec=$out/etc/xdg/xfce4/xinitrc"
+  '';
+
+  passthru = {
+    xinitrc = "${xfce4-session}/etc/xdg/xfce4/xinitrc";
+
+    providedSessions = [
+      "xfce"
+    ];
+  };
+
+  meta = {
     description = "Session manager for Xfce";
   };
 }