summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Tropin <andrew@trop.in>2021-08-31 15:24:25 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2021-09-09 20:26:51 +0300
commit5d4f39e64ab446f11d22721464c2dc418c0d9b98 (patch)
tree25f860cb7e0fa392d381d2e2f325ac3a1bf6d0f8
parent3087a5cfa05b682564c78a0f79a0d49ef6f9b31a (diff)
downloadguix-5d4f39e64ab446f11d22721464c2dc418c0d9b98.tar.gz
home-services: run-on-change: Handle first generation case.
* gnu/home-services.scm
(compute-on-change-gexp): Handle first generation case.

Signed-off-by: Oleg Pykhalov <go.wigust@gmail.com>
-rw-r--r--gnu/home-services.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/gnu/home-services.scm b/gnu/home-services.scm
index 2a773496f0..9f1e986616 100644
--- a/gnu/home-services.scm
+++ b/gnu/home-services.scm
@@ -439,7 +439,10 @@ with one gexp, but many times, and all gexps must be idempotent.")))
       (define expressions-to-eval
         (map
          (lambda (x)
-           (let* ((file1 (string-append (getenv "GUIX_OLD_HOME") "/" (car x)))
+           (let* ((file1 (string-append
+                          (or (getenv "GUIX_OLD_HOME")
+                              "/gnu/store/non-existing-generation")
+                          "/" (car x)))
                   (file2 (string-append (getenv "GUIX_NEW_HOME") "/" (car x)))
                   (_ (format #t "Comparing ~a and\n~10t~a..." file1 file2))
                   (any-changes? (something-changed? file1 file2))
@@ -454,7 +457,8 @@ with one gexp, but many times, and all gexps must be idempotent.")))
             (for-each primitive-eval expressions-to-eval)
             (display "On-change gexps evaluation finished.\n\n"))
           (display "\
-On-change gexps won't evaluated, disabled by service configuration.\n"))))
+On-change gexps won't be evaluated, disabled by service
+configuration.\n"))))
 
 (define home-run-on-change-service-type
   (service-type (name 'home-run-on-change)