diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-02T11·33+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-06-02T14·02+0200 |
commit | 812c0dfbe24c8fe93992f77abbf1e5a975ea42f4 (patch) | |
tree | d69bcc87ce446f270f6b01f7069655223d52a626 /src/nix-instantiate | |
parent | f2682e6e18a76ecbfb8a12c17e3a0ca15c084197 (diff) |
Allow setting the state directory as a store parameter
E.g. "local?store=/tmp/store&state=/tmp/var".
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r-- | src/nix-instantiate/nix-instantiate.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index 7dce08400e82..c1b0b0ea092d 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -79,7 +79,9 @@ void processExpr(EvalState & state, const Strings & attrPaths, else { Path rootName = gcRoot; if (++rootNr > 1) rootName += "-" + std::to_string(rootNr); - drvPath = state.store->addPermRoot(drvPath, rootName, indirectRoot); + auto store2 = state.store.dynamic_pointer_cast<LocalFSStore>(); + if (store2) + drvPath = store2->addPermRoot(drvPath, rootName, indirectRoot); } std::cout << format("%1%%2%\n") % drvPath % (outputName != "out" ? "!" + outputName : ""); } |