]> git.ekhem.eu.org Git - guix.git/commitdiff
[home] Resolve symlinks starting from `GUIX_PACKAGE_PATH`.
authorJakub Czajka <jakub@ekhem.eu.org>
Thu, 22 Dec 2022 19:14:58 +0000 (20:14 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:53:07 +0000 (19:53 +0100)
Files to symlink are located inside `GUIX_PACKAGE_PATH`. Specifying
this variable every time is redundant. This commit hides the lookup.

conf/home/symlink.scm

index 2935cf87393a91f852bf0b0d85cb63fd2de34629..1470b97e5e714ea05a19ac520ef4e923b5bac39d 100644 (file)
   #:export (home-symlink-service-type))
 
 (define (symlink paths)
+  (define (conf-home file)
+    (string-concatenate
+     (list (getenv "GUIX_PACKAGE_PATH") "/" file)))
+
   (define (make-symlink-pair path)
-    (let ((file (local-file path))
-         (first-slash (string-index path #\/)))
+    (let* ((conf-path (conf-home path))
+          (file (local-file conf-path #:recursive? #t))
+          (first-slash (string-index path #\/)))
       (if first-slash
          (list (substring path (+ first-slash 1))
                file)