diff --git a/core/src/nix/path.sld b/core/src/nix/path.sld index 5629c47..0a56ffa 100644 --- a/core/src/nix/path.sld +++ b/core/src/nix/path.sld @@ -3,13 +3,14 @@ ;; These helpers all use the `%store-dir` parameter as base store directory. (define-library (zilch nix path) (import - (scheme base) + (scheme base) (srfi 152) (zilch lib hash) (zilch nix hash)) (export %store-dir impure-placeholder make-upstream-output-placeholder make-placeholder - make-store-path-from-parts make-text-path make-fixed-output-path make-output-path) + make-store-path-from-parts make-text-path make-fixed-output-path make-output-path + make-fixed-output-with-references) (begin ;; The path to the store dir, as a parameter. @@ -61,4 +62,9 @@ (sha256 (string->utf8 (string-append "fixed:out:" (if recursive "r:" "") hash-algo ":" (hex hash-value) ":"))) - name))))) + name))) + + (define (make-fixed-output-with-references hash-value name references self-references) + (make-store-path-from-parts + (string-join (append (cons "source" references) (if self-references '("self") '())) ":") + "sha256" hash-value name))))