diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-11-17 23:24:42 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-11-17 23:43:14 +0100 |
commit | 3a317f7476f8c6012e166ff9f340f861938721c9 (patch) | |
tree | 946e398c37912cfc03be7306951ae87bfeb130fa /gnu/home | |
parent | e55547bf70384691712047912c793c517debd2ec (diff) | |
parent | 62e707d67caf1dab2af411a69ff8cec4b2dc686e (diff) | |
download | guix-3a317f7476f8c6012e166ff9f340f861938721c9.tar.gz |
Merge branch 'master' into core-updates-frozen
Diffstat (limited to 'gnu/home')
-rw-r--r-- | gnu/home/services.scm | 21 | ||||
-rw-r--r-- | gnu/home/services/shells.scm | 8 | ||||
-rw-r--r-- | gnu/home/services/utils.scm | 2 | ||||
-rw-r--r-- | gnu/home/services/xdg.scm | 2 |
4 files changed, 19 insertions, 14 deletions
diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 5c9b743f7b..04f4ec34d1 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -275,7 +275,7 @@ directory containing FILES." will be put in @file{~/.guix-home/files}."))) (define (compute-on-first-login-script _ gexps) - (gexp->script + (program-file "on-first-login" #~(let* ((xdg-runtime-dir (or (getenv "XDG_RUNTIME_DIR") (format #f "/run/user/~a" (getuid)))) @@ -286,14 +286,19 @@ 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)))))) - -(define (on-first-login-script-entry m-on-first-login) + (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 on-first-login) "Return, as a monadic value, an entry for the on-first-login script in the home environment directory." - (mlet %store-monad ((on-first-login m-on-first-login)) - (return `(("on-first-login" ,on-first-login))))) + (with-monad %store-monad + (return `(("on-first-login" ,on-first-login))))) (define home-run-on-first-login-service-type (service-type (name 'home-run-on-first-login) @@ -346,7 +351,7 @@ extended with one gexp."))) (unless new-home-env (setenv "GUIX_NEW_HOME" #f)) (unless old-home-env (setenv "GUIX_OLD_HOME" #f))) (format #t "\ -Activation script was either called or loaded by file from this direcotry: +Activation script was either called or loaded by file from this directory: ~a It doesn't seem that home environment is somewhere around. Make sure that you call ./activate by symlink from -home store item.\n" diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index 81d07da86c..80f13a31b7 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -69,7 +69,7 @@ only be extended. @code{profile} is a list of file-like objects, which will go to @file{~/.profile}. By default @file{~/.profile} contains the initialization code, which have to be evaluated by login shell to make -home-environment's profile avaliable to the user, but other commands +home-environment's profile available to the user, but other commands can be added to the file if it is really necessary. In most cases shell's configuration files are preferred places for @@ -420,9 +420,9 @@ alias grep='grep --color=auto'\n") (not (null? ((configuration-field-getter field-obj) config)))) `(,(object->snake-case-string file-name) ,(apply mixed-text-file - (object->snake-case-string file-name) - (cons (serialize-field field) - (if extra-content extra-content '())))) + (object->snake-case-string file-name) + (append (or extra-content '()) + (list (serialize-field field))))) '()))) (filter diff --git a/gnu/home/services/utils.scm b/gnu/home/services/utils.scm index cea75ee896..3ce32f80c0 100644 --- a/gnu/home/services/utils.scm +++ b/gnu/home/services/utils.scm @@ -28,7 +28,7 @@ list->human-readable-list)) (define (maybe-object->string object) - "Like @code{object->string} but don't do anyting if OBJECT already is + "Like @code{object->string} but don't do anything if OBJECT already is a string." (if (string? object) object diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 20fb7f7b40..d230dd7665 100644 --- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -136,7 +136,7 @@ are no extensions use configuration instead." (description "Configure XDG base directories. This service introduces two additional variables @env{XDG_STATE_HOME}, @env{XDG_LOG_HOME}. They are not a part of XDG specification, at -least yet, but are convinient to have, it improves the consistency +least yet, but are convenient to have, it improves the consistency between different home services. The services of this service-type is instantiated by default, to provide non-default value, extend the service-type (using @code{simple-service} for example)."))) |