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

16 lines
405 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 {
2024-05-03 16:41:03 +03:00
ref<SourceAccessor> makeStorePathAccessor(ref<Store> store, const StorePath & storePath)
2024-05-03 13:30:28 +03:00
{
// FIXME: should use `store->getFSAccessor()`
2024-05-03 16:41:03 +03:00
auto root = std::filesystem::path{store->toRealPath(storePath)};
2024-05-03 13:30:28 +03:00
auto accessor = makeFSSourceAccessor(root);
accessor->setPathDisplay(root.string());
return accessor;
}
}