summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 8145d51143..4df7b06181 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -157,6 +157,14 @@
"Return the <derivation> object INPUT refers to."
(read-derivation-from-file (derivation-input-path input)))
+(define* (derivation-input drv #:optional
+ (outputs (derivation-output-names drv)))
+ "Return a <derivation-input> for the OUTPUTS of DRV."
+ ;; This is a public interface meant to be more convenient than
+ ;; 'make-derivation-input' and giving us more control.
+ (make-derivation-input (derivation-file-name drv)
+ outputs))
+
(set-record-type-printer! <derivation>
(lambda (drv port)
(format port "#<derivation ~a => ~a ~a>"