services: 'file-union' makes sure each source file exists.
[jackhill/guix/guix.git] / gnu / services.scm
index 056bb2a..1ad5737 100644 (file)
@@ -291,7 +291,12 @@ file."
                      (chdir #$output)
                      #$@(map (match-lambda
                                ((target source)
-                                #~(symlink #$source #$target)))
+                                #~(begin
+                                    ;; Stat the source to abort early if it
+                                    ;; does not exist.
+                                    (stat #$source)
+
+                                    (symlink #$source #$target))))
                              files))))
 
 (define (directory-union name things)