me
/
guix
Archived
1
0
Fork 0

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.
Andrew Tropin 2022-12-22 10:22:00 +04:00
parent 1b29fccff2
commit dd4eee5581
No known key found for this signature in database
GPG Key ID: 2208D20958C1DEB0
1 changed files with 19 additions and 16 deletions

View File

@ -120,22 +120,25 @@ services more consistent."))
home-xdg-base-directories-configuration-fields)) home-xdg-base-directories-configuration-fields))
(define (ensure-xdg-base-dirs-on-activation config) (define (ensure-xdg-base-dirs-on-activation config)
#~(map (lambda (xdg-base-dir-variable) (with-imported-modules '((guix build utils))
((@ (guix build utils) mkdir-p) #~(begin
(getenv (use-modules (guix build utils))
xdg-base-dir-variable))) (map (lambda (xdg-base-dir-variable)
'#$(filter-map (mkdir-p
(lambda (field) (getenv
(let ((variable xdg-base-dir-variable)))
(string-append '#$(filter-map
"XDG_" (lambda (field)
(object->snake-case-string (let ((variable
(configuration-field-name field) 'upper)))) (string-append
;; XDG_RUNTIME_DIR shouldn't be created during activation "XDG_"
;; and will be provided by elogind or other service. (object->snake-case-string
(and (not (string=? "XDG_RUNTIME_DIR" variable)) (configuration-field-name field) 'upper))))
variable))) ;; XDG_RUNTIME_DIR shouldn't be created during activation
home-xdg-base-directories-configuration-fields))) ;; 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) (define (last-extension-or-cfg config extensions)
"Picks configuration value from last provided extension. If there "Picks configuration value from last provided extension. If there