From: Jakub Czajka Date: Thu, 22 Dec 2022 19:14:58 +0000 (+0100) Subject: [home] Resolve symlinks starting from `GUIX_PACKAGE_PATH`. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=1bdcc9ded7a857b6b712a4efa3abe7931f969c34;p=guix.git [home] Resolve symlinks starting from `GUIX_PACKAGE_PATH`. Files to symlink are located inside `GUIX_PACKAGE_PATH`. Specifying this variable every time is redundant. This commit hides the lookup. --- diff --git a/conf/home/symlink.scm b/conf/home/symlink.scm index 2935cf8..1470b97 100644 --- a/conf/home/symlink.scm +++ b/conf/home/symlink.scm @@ -12,9 +12,14 @@ #: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)