mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
Fix flake evaluation in chroot stores
This is a temporary fix until we can pass `SourcePath`s rather than `StorePath`s to `call-flake.nix`. Fixes #10331.
This commit is contained in:
parent
189e40214e
commit
c0dd111af1
1 changed files with 12 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include "finally.hh"
|
#include "finally.hh"
|
||||||
#include "fetch-settings.hh"
|
#include "fetch-settings.hh"
|
||||||
#include "value-to-json.hh"
|
#include "value-to-json.hh"
|
||||||
|
#include "local-fs-store.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
@ -755,7 +756,17 @@ void callFlake(EvalState & state,
|
||||||
|
|
||||||
auto lockedNode = node.dynamic_pointer_cast<const LockedNode>();
|
auto lockedNode = node.dynamic_pointer_cast<const LockedNode>();
|
||||||
|
|
||||||
auto [storePath, subdir] = state.store->toStorePath(sourcePath.path.abs());
|
// FIXME: This is a hack to support chroot stores. Remove this
|
||||||
|
// once we can pass a sourcePath rather than a storePath to
|
||||||
|
// call-flake.nix.
|
||||||
|
auto path = sourcePath.path.abs();
|
||||||
|
if (auto store = state.store.dynamic_pointer_cast<LocalFSStore>()) {
|
||||||
|
auto realStoreDir = store->getRealStoreDir();
|
||||||
|
if (isInDir(path, realStoreDir))
|
||||||
|
path = store->storeDir + path.substr(realStoreDir.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto [storePath, subdir] = state.store->toStorePath(path);
|
||||||
|
|
||||||
emitTreeAttrs(
|
emitTreeAttrs(
|
||||||
state,
|
state,
|
||||||
|
|
Loading…
Reference in a new issue