Archived
1
0
Fork 0

home: symlink-manager: Clarify module imports.

* gnu/home/services/symlink-manager.scm (update-symlinks-script): Wrap
body in 'with-imported-modules'.  Move (guix build utils) import to the
top.  Move #$%initialize-gettext after definitions.
This commit is contained in:
Ludovic Courtès 2022-02-18 15:43:57 +01:00
parent 25afd66a81
commit 66bf60a4cd
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -20,7 +20,7 @@
(define-module (gnu home services symlink-manager) (define-module (gnu home services symlink-manager)
#:use-module (gnu home services) #:use-module (gnu home services)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix modules)
#:export (home-symlink-manager-service-type)) #:export (home-symlink-manager-service-type))
;;; Comment: ;;; Comment:
@ -37,13 +37,17 @@
(define (update-symlinks-script) (define (update-symlinks-script)
(program-file (program-file
"update-symlinks" "update-symlinks"
(with-imported-modules (source-module-closure
'((guix build utils)
(guix i18n)))
#~(begin #~(begin
(use-modules (ice-9 ftw) (use-modules (ice-9 ftw)
(ice-9 curried-definitions) (ice-9 curried-definitions)
(ice-9 match) (ice-9 match)
(srfi srfi-1) (srfi srfi-1)
(guix i18n)) (guix i18n)
#$%initialize-gettext (guix build utils))
(define ((simplify-file-tree parent) file) (define ((simplify-file-tree parent) file)
"Convert the result produced by `file-system-tree' to less "Convert the result produced by `file-system-tree' to less
verbose and more suitable for further processing format. verbose and more suitable for further processing format.
@ -84,7 +88,7 @@ appear only after all nested items already listed."
(list (cons 'dir path)) (list (cons 'dir path))
(append-map (file-tree-traverse preordering) rest)))))) (append-map (file-tree-traverse preordering) rest))))))
(use-modules (guix build utils)) #$%initialize-gettext
(let* ((config-home (or (getenv "XDG_CONFIG_HOME") (let* ((config-home (or (getenv "XDG_CONFIG_HOME")
(string-append (getenv "HOME") "/.config"))) (string-append (getenv "HOME") "/.config")))
@ -231,7 +235,7 @@ appear only after all nested items already listed."
(symlink new-home new-he-path) (symlink new-home new-he-path)
(rename-file new-he-path he-path) (rename-file new-he-path he-path)
(display (G_" done\nFinished updating symlinks.\n\n")))))) (display (G_" done\nFinished updating symlinks.\n\n")))))))
(define (update-symlinks-gexp _) (define (update-symlinks-gexp _)