[RFC 0196] Self-describing store#196
Conversation
| as well as slightly reduce the number of requests. | ||
| The details of such an integration would be decided by those involved with RFC 195. | ||
|
|
||
| ## Concrete example: the case hack |
There was a problem hiding this comment.
I'm missing two very simple examples, a directory containing NARInfo files and NAR files (with whatever compression), and the one at ../../var/nix/db/nix-store.json.
There's arguably a big difference to storing Nars or unpacked files, and I feel like we're missing some format field of some sort. It doesn't map nicely to the more additive nature of features.
There was a problem hiding this comment.
Maybe it is also filesystem object encoding like casehack?
roberth
left a comment
There was a problem hiding this comment.
Clarification: store state and metadata, not all settings.
| ``` | ||
|
|
||
| ## Fields | ||
|
|
There was a problem hiding this comment.
| The following list of fields is exhaustive until new fields are specified in follow-up RFCs. | |
| Unspecified fields MUST be ignored. | |
| Instead, fields that are essential to the store's integrity should be specified, and settings that are not should be handled through other means, such as the client's configuration system. | |
E.g. Nix local store has options that are implementation-specific or not even applicable:
build-dir: Nix settings currently combine some build settings into the store. They're correlated but only as an implementation detail.use-roots-daemon: has little bearing on the store storage and it can continue to live innix.confreal(implied in the context ofnix-store.json, as the client knows where it is)
| ## Metadata file | ||
|
|
||
| Stores provide a `nix-store.json` file containing metadata in JSON format. | ||
|
|
There was a problem hiding this comment.
| This file should be regarded as persistent state of the underlying store representation rather than a configuration file. | |
| Stores provide a `nix-store.json` file containing metadata in JSON format. | ||
|
|
||
| ```json | ||
| { |
There was a problem hiding this comment.
Perhaps it should even include:
| { | |
| { | |
| "_comment": "DO NOT EDIT THIS FILE BY HAND. Doing so may violate invariants that cause the store to be corrupted.", |
| "wantMassQuery": true, | ||
| "priority": 40 |
There was a problem hiding this comment.
Worth noting that these were grandfathered in.
Especially priority should have been client-side configuration.
It is weird and of questionable utility.
This RFC proposes that stores provide a
nix-store.jsonfile declaring their properties, enabling:nix-cache-infoformatRendered: https://github.com/roberth/rfcs/blob/self-describing-store/rfcs/0196-self-describing-store.md
Shepherd nominations welcome!