summary refs log tree commit diff
path: root/gnu/home
diff options
context:
space:
mode:
authorAndrew Tropin <andrew@trop.in>2021-10-07 08:12:04 +0300
committerLudovic Courtès <ludo@gnu.org>2021-11-14 23:18:08 +0100
commit5c2f30d3de6507d868a1f38563170f6e49a7bb44 (patch)
tree2900c170f57e3b59842c84954d924ecf01f11a0d /gnu/home
parent2ebcc5387bac6fcf25272d0b9f0c5ac4cb1f1d24 (diff)
downloadguix-5c2f30d3de6507d868a1f38563170f6e49a7bb44.tar.gz
home-services: on-first-login: Check if XDG_RUNTIME_DIR exists.
Fixes <https://issues.guix.gnu.org/50945>.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* gnu/home-services.scm (on-first-login): on-first-login won't execute
anything if XDG_RUNTIME_DIR doesn't exists.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/home')
-rw-r--r--gnu/home/services.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 5c9b743f7b..1e295b6afe 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -286,8 +286,13 @@ will be put in @file{~/.guix-home/files}.")))
        ;; XDG_RUNTIME_DIR dissapears on logout, that means such trick
        ;; allows to launch on-first-login script on first login only
        ;; after complete logout/reboot.
-       (when (not (file-exists? flag-file-path))
-         (begin #$@gexps (touch flag-file-path))))))
+       (if (file-exists? xdg-runtime-dir)
+           (unless (file-exists? flag-file-path)
+             (begin #$@gexps (touch flag-file-path)))
+           (display "XDG_RUNTIME_DIR doesn't exists, on-first-login script
+won't execute anything.  You can check if xdg runtime directory exists,
+XDG_RUNTIME_DIR variable is set to apropriate value and manually execute the
+script by running '$HOME/.guix-home/on-first-login'")))))
 
 (define (on-first-login-script-entry m-on-first-login)
   "Return, as a monadic value, an entry for the on-first-login script