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:
parent
e5e0ce2334
commit
774b924398
4 changed files with 35 additions and 35 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue