Subject: [bug#67831] [PATCH v2] services: xorg: Find sessions from guix home directory.

From: Feng Shu <[email-masked]>
Date: Fri, 15 Dec 2023 08:36:34 +0800

>From 0e3968aff482ed8ef912f02b744631bb8899f9e4 Mon Sep 17 00:00:00 2001
From: Feng Shu <[email-masked]>
Date: Thu, 14 Dec 2023 10:58:02 +0800
Subject: [PATCH v2] services: xorg: Find sessions from guix home directory.

* gnu/services/xorg.scm (xinitrc): Find sessions from guix home directory.
---
 gnu/services/xorg.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index f8cf9f25b6..9235295dd6 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -458,6 +458,11 @@ (define user-profile
                  (lambda (pw)
                    (string-append (passwd:dir pw) "/.guix-profile"))))
 
+        (define guix-home-profile
+          (and=> (getpw (getuid))
+                 (lambda (pw)
+                   (string-append (passwd:dir pw) "/.guix-home/profile"))))
+
         (define (xsession-command desktop-file)
           ;; Read from DESKTOP-FILE its X session command and return it as a
           ;; list.
@@ -503,6 +508,7 @@ (define (find-session profile)
               (apply exec-from-login-shell
                      (or session
                          (find-session user-profile)
+                         (find-session guix-home-profile)
                          (find-session system-profile)))))))
 
   (program-file "xinitrc" builder))
-- 
2.39.2