1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

Add a storeFS accessor for paths resulting from IFD

Hopefully fixes #11503.
This commit is contained in:
Eelco Dolstra 2025-02-18 23:03:30 +01:00
parent e5e0ce2334
commit 774b924398
4 changed files with 35 additions and 35 deletions

View file

@ -1,4 +1,5 @@
#include "eval.hh"
#include "store-api.hh"
namespace nix {
@ -12,4 +13,10 @@ SourcePath EvalState::rootPath(PathView path)
return {rootFS, CanonPath(absPath(path))};
}
SourcePath EvalState::stringWithContextToPath(std::string_view s, const NixStringContext & context)
{
auto path = CanonPath(s);
return !context.empty() ? SourcePath{storeFS, std::move(path)} : rootPath(std::move(path));
}
}