1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-08 16:28:52 +02:00

home: xdg: Add with-imported-modules to xdg activation script.

Without it activation doesn't work when called in clean environment.

* gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Add
with-imported-modules to xdg activation script.
This commit is contained in:
Andrew Tropin
2022-12-22 10:22:00 +04:00
parent 1b29fccff2
commit dd4eee5581
+19 -16
View File
@@ -120,22 +120,25 @@ services more consistent."))
home-xdg-base-directories-configuration-fields))
(define (ensure-xdg-base-dirs-on-activation config)
#~(map (lambda (xdg-base-dir-variable)
((@ (guix build utils) mkdir-p)
(getenv
xdg-base-dir-variable)))
'#$(filter-map
(lambda (field)
(let ((variable
(string-append
"XDG_"
(object->snake-case-string
(configuration-field-name field) 'upper))))
;; XDG_RUNTIME_DIR shouldn't be created during activation
;; and will be provided by elogind or other service.
(and (not (string=? "XDG_RUNTIME_DIR" variable))
variable)))
home-xdg-base-directories-configuration-fields)))
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(map (lambda (xdg-base-dir-variable)
(mkdir-p
(getenv
xdg-base-dir-variable)))
'#$(filter-map
(lambda (field)
(let ((variable
(string-append
"XDG_"
(object->snake-case-string
(configuration-field-name field) 'upper))))
;; XDG_RUNTIME_DIR shouldn't be created during activation
;; and will be provided by elogind or other service.
(and (not (string=? "XDG_RUNTIME_DIR" variable))
variable)))
home-xdg-base-directories-configuration-fields)))))
(define (last-extension-or-cfg config extensions)
"Picks configuration value from last provided extension. If there