nix-super/src/libfetchers/store-path-accessor.cc

18 lines
417 B
C++
Raw Normal View History

2024-05-03 13:30:28 +03:00
#include "store-path-accessor.hh"
#include "store-api.hh"
namespace nix {
ref<SourceAccessor> makeStorePathAccessor(
ref<Store> store,
const StorePath & storePath)
{
// FIXME: should use `store->getFSAccessor()`
auto root = std::filesystem::path { store->toRealPath(storePath) };
auto accessor = makeFSSourceAccessor(root);
accessor->setPathDisplay(root.string());
return accessor;
}
}