From 5966b76c974a8f2eddac8c610b754a2dbcf8bb9b Mon Sep 17 00:00:00 2001 From: Ben Radford Date: Wed, 17 May 2023 08:49:51 +0100 Subject: [PATCH] Document the new read-only local store setting. --- src/libstore/local-store.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 1557c6242..7fcf645e7 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -49,7 +49,18 @@ struct LocalStoreConfig : virtual LocalFSStoreConfig Setting readOnly{(StoreConfig*) this, false, "read-only", - "TODO"}; + R"( + Allow this store to be opened when its database is on a read-only filesystem. + + Normally Nix will attempt to open the store database in read-write mode, even + for querying (when write access is not needed). This causes it to fail if the + database is on a read-only filesystem. + + Enable read-only mode to disable locking and open the SQLite database with the + **imutable** parameter set. Do not use this unless the filesystem is read-only. + Using it when the filesystem is writable can cause incorrect query results or + corruption errors if the database is changed by another process. + )"}; const std::string name() override { return "Local Store"; }