18MakeError(BadStorePath, Error);
19MakeError(BadStorePathName, BadStorePath);
21struct StoreDirConfig :
public Config
25 StoreDirConfig() =
delete;
27 virtual ~StoreDirConfig() =
default;
29 const PathSetting storeDir_{
this, settings.nixStore,
32 Logical location of the Nix store, usually
33 `/nix/store`. Note that you can only copy store paths
34 between stores if they have the same `store` setting.
36 const Path storeDir = storeDir_;
40 StorePath parseStorePath(std::string_view path)
const;
42 std::optional<StorePath> maybeParseStorePath(std::string_view path)
const;
44 std::string printStorePath(
const StorePath & path)
const;
53 PathSet printStorePathSet(
const StorePathSet & path)
const;
59 std::string
showPaths(
const StorePathSet & paths);
77 std::pair<StorePath, Path>
toStorePath(PathView path)
const;
83 std::string_view hash, std::string_view
name)
const;
85 const Hash & hash, std::string_view
name)
const;
87 StorePath makeOutputPath(std::string_view
id,
88 const Hash & hash, std::string_view
name)
const;
99 std::string_view
name,
102 HashAlgorithm hashAlgo = HashAlgorithm::SHA256,
103 const StorePathSet & references = {},
104 PathFilter & filter = defaultPathFilter)
const;
@ NixArchive
Definition file-content-address.hh:114
std::function< bool(const Path &path)> PathFilter
Definition file-system.hh:365
ValueType type
Definition lexer.l:7098
const std::string_view & name
Definition lexer.l:1709
Definition content-address.hh:31
Definition content-address.hh:276
Definition content-address.hh:249
Definition source-path.hh:22
StorePathSet parseStorePathSet(const PathSet &paths) const
Definition path.cc:111
StorePath makeStorePath(std::string_view type, std::string_view hash, std::string_view name) const
Definition store-api.cc:80
bool isInStore(PathView path) const
Definition store-api.cc:32
std::pair< StorePath, Hash > computeStorePath(std::string_view name, const SourcePath &path, ContentAddressMethod method=FileIngestionMethod::NixArchive, HashAlgorithm hashAlgo=HashAlgorithm::SHA256, const StorePathSet &references={}, PathFilter &filter=defaultPathFilter) const
Definition store-api.cc:165
std::string showPaths(const StorePathSet &paths)
Definition store-api.cc:1208
bool isStorePath(std::string_view path) const
Definition path.cc:106
std::pair< StorePath, Path > toStorePath(PathView path) const
Definition store-api.cc:38
std::string Path
Definition types.hh:22