From 1bdcc9ded7a857b6b712a4efa3abe7931f969c34 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Thu, 22 Dec 2022 20:14:58 +0100 Subject: [PATCH] [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. --- conf/home/symlink.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.39.5