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

16 lines
405 B
C++
Raw Normal View History

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