8struct LocalOverlayStoreConfig :
virtual LocalStoreConfig
10 LocalOverlayStoreConfig(
const StringMap & params)
11 : LocalOverlayStoreConfig(
"local-overlay",
"", params)
14 LocalOverlayStoreConfig(std::string_view scheme, PathView path,
const Params & params)
17 , LocalStoreConfig(scheme, path, params)
23 [Store URL](@docroot@/command-ref/new-cli/nix3-help-stores.md#store-url-format)
24 for the lower store. The default is `auto` (i.e. use the Nix daemon or `/nix/store` directly).
26 Must be a store with a store dir on the file system.
27 Must be used as OverlayFS lower layer for this store's store dir.
32 Directory containing the OverlayFS upper layer for this store's store dir.
37 Check that the overlay filesystem is correctly mounted.
39 Nix does not manage the overlayfs mount point itself, but the correct
40 functioning of the overlay store does depend on this mount point being set up
41 correctly. Rather than just assume this is the case, check that the lowerdir
42 and upperdir options are what we expect them to be. This check is on by
43 default, but can be disabled if needed.
48 Script or other executable to run when overlay filesystem needs remounting.
50 This is occasionally necessary when deleting a store path that exists in both upper and lower layers.
51 In such a situation, bypassing OverlayFS and deleting the path in the upper layer directly
52 is the only way to perform the deletion without creating a "whiteout".
53 However this causes the OverlayFS kernel data structures to get out-of-sync,
54 and can lead to 'stale file handle' errors; remounting solves the problem.
56 The store directory is passed as an argument to the invoked executable.
59 const std::string
name()
override {
return "Experimental Local Overlay Store"; }
63 return ExperimentalFeature::LocalOverlayStore;
66 static std::set<std::string> uriSchemes()
68 return {
"local-overlay" };
71 std::string
doc()
override;
91class LocalOverlayStore :
public virtual LocalOverlayStoreConfig,
public virtual LocalStore
103 LocalOverlayStore(
const Params & params)
104 : LocalOverlayStore(
"local-overlay",
"", params)
108 LocalOverlayStore(std::string_view scheme, PathView path,
const Params & params);
112 return "local-overlay://";
120 void registerDrvOutput(
const Realisation & info)
override;
125 void queryPathInfoUncached(
const StorePath & path,
126 Callback<std::shared_ptr<const ValidPathInfo>> callback)
noexcept override;
134 bool isValidPathUncached(
const StorePath & path)
override;
139 void queryReferrers(
const StorePath & path, StorePathSet & referrers)
override;
144 StorePathSet queryValidDerivers(
const StorePath & path)
override;
149 std::optional<StorePath> queryPathFromHashPart(
const std::string & hashPart)
override;
155 void registerValidPaths(
const ValidPathInfos & infos)
override;
160 void queryRealisationUncached(
const DrvOutput&,
161 Callback<std::shared_ptr<const Realisation>> callback)
noexcept override;
172 void deleteStorePath(
const Path & path, uint64_t & bytesFreed)
override;
187 void optimiseStore()
override;
198 VerificationResult verifyAllValidPaths(RepairFlag
repair)
override;
203 void queryGCReferrers(
const StorePath & path, StorePathSet & referrers)
override;
210 void remountIfNecessary();
215 std::atomic_bool _remountRequired =
false;
Definition callback.hh:17
std::string getUri() override
Definition local-overlay-store.hh:110
LocalStore(const Params ¶ms)
Definition local-store.cc:354
RepairFlag repair
Definition lexer.l:7173
Definition realisation.hh:24
Definition gc-store.hh:15
Definition gc-store.hh:60
std::optional< ExperimentalFeature > experimentalFeature() const override
Definition local-overlay-store.hh:61
std::string doc() override
Definition local-overlay-store.cc:10
const std::string name() override
Definition local-overlay-store.hh:59
Path toUpperPath(const StorePath &path)
Definition local-overlay-store.cc:17
LocalFSStoreConfig(PathView path, const Params ¶ms)
Definition local-fs-store.cc:11
Definition realisation.hh:49
Definition store-api.hh:101
std::string Path
Definition types.hh:22