home-services: Demonadify 'on-first-login' handling.

* gnu/home/services.scm (compute-on-first-login-script): Use
'computed-file' instead of' gexp->script'.
(on-first-login-script-entry): Expect a regular value rather than a
monadic value and remove 'mlet'.
This commit is contained in:
Ludovic Courtès 2021-11-14 23:06:49 +01:00
parent a8b5b40f62
commit 4dcec60fa6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -275,7 +275,7 @@ (define home-files-service-type
will be put in @file{~/.guix-home/files}."))) will be put in @file{~/.guix-home/files}.")))
(define (compute-on-first-login-script _ gexps) (define (compute-on-first-login-script _ gexps)
(gexp->script (computed-file
"on-first-login" "on-first-login"
#~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") #~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR")
(format #f "/run/user/~a" (getuid)))) (format #f "/run/user/~a" (getuid))))
@ -294,10 +294,10 @@ (define (compute-on-first-login-script _ gexps)
XDG_RUNTIME_DIR variable is set to apropriate value and manually execute the XDG_RUNTIME_DIR variable is set to apropriate value and manually execute the
script by running '$HOME/.guix-home/on-first-login'"))))) script by running '$HOME/.guix-home/on-first-login'")))))
(define (on-first-login-script-entry m-on-first-login) (define (on-first-login-script-entry on-first-login)
"Return, as a monadic value, an entry for the on-first-login script "Return, as a monadic value, an entry for the on-first-login script
in the home environment directory." in the home environment directory."
(mlet %store-monad ((on-first-login m-on-first-login)) (with-monad %store-monad
(return `(("on-first-login" ,on-first-login))))) (return `(("on-first-login" ,on-first-login)))))
(define home-run-on-first-login-service-type (define home-run-on-first-login-service-type