about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 28bbd2859ac9..12cc272f7152 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -270,6 +270,9 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args)
                 % *i % drvName);
         }
 
+    /* !!! the name should not end in the derivation extension (.drv).
+       Likewise for sources. */
+
     /* Construct the "masked" derivation store expression, which is
        the final one except that in the list of outputs, the output
        paths are empty, and the corresponding environment variables
@@ -290,7 +293,7 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args)
         DerivationOutput(outPath, outputHashAlgo, outputHash);
 
     /* Write the resulting term into the Nix store directory. */
-    Path drvPath = writeTerm(unparseDerivation(drv), "d-" + drvName);
+    Path drvPath = writeDerivation(drv, drvName);
 
     printMsg(lvlChatty, format("instantiated `%1%' -> `%2%'")
         % drvName % drvPath);