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>
This commit is contained in:
parent
3087a5cfa0
commit
5d4f39e64a
1 changed files with 6 additions and 2 deletions
|
@ -439,7 +439,10 @@ with one gexp, but many times, and all gexps must be idempotent.")))
|
||||||
(define expressions-to-eval
|
(define expressions-to-eval
|
||||||
(map
|
(map
|
||||||
(lambda (x)
|
(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)))
|
(file2 (string-append (getenv "GUIX_NEW_HOME") "/" (car x)))
|
||||||
(_ (format #t "Comparing ~a and\n~10t~a..." file1 file2))
|
(_ (format #t "Comparing ~a and\n~10t~a..." file1 file2))
|
||||||
(any-changes? (something-changed? 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)
|
(for-each primitive-eval expressions-to-eval)
|
||||||
(display "On-change gexps evaluation finished.\n\n"))
|
(display "On-change gexps evaluation finished.\n\n"))
|
||||||
(display "\
|
(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
|
(define home-run-on-change-service-type
|
||||||
(service-type (name 'home-run-on-change)
|
(service-type (name 'home-run-on-change)
|
||||||
|
|
Reference in a new issue