mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Introduce MemoryInputAccessor and use it for corepkgs
MemoryInputAccessor is an in-memory virtual filesystem that returns files like <nix/fetchurl.nix>. This removes the need for special hacks to handle those files.
This commit is contained in:
parent
ea38605d11
commit
df73c6eb8c
11 changed files with 176 additions and 98 deletions
|
@ -64,7 +64,6 @@ struct StringToken {
|
|||
|
||||
#include "parser-tab.hh"
|
||||
#include "lexer-tab.hh"
|
||||
#include "fs-input-accessor.hh"
|
||||
|
||||
YY_DECL;
|
||||
|
||||
|
@ -650,6 +649,8 @@ formal
|
|||
#include "fetchers.hh"
|
||||
#include "store-api.hh"
|
||||
#include "flake/flake.hh"
|
||||
#include "fs-input-accessor.hh"
|
||||
#include "memory-input-accessor.hh"
|
||||
|
||||
|
||||
namespace nix {
|
||||
|
@ -761,7 +762,7 @@ SourcePath EvalState::findFile(const SearchPath & searchPath, const std::string_
|
|||
}
|
||||
|
||||
if (hasPrefix(path, "nix/"))
|
||||
return rootPath(CanonPath(concatStrings(corepkgsPrefix, path.substr(4))));
|
||||
return {corepkgsFS, CanonPath(path.substr(3))};
|
||||
|
||||
debugThrow(ThrownError({
|
||||
.msg = hintfmt(evalSettings.pureEval
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue