[Nix-dev] nix-store --dump-db / --load-db for specific paths?
Rickard Nilsson
rickard.nilsson at telia.com
Fri Dec 20 12:23:18 CET 2013
On 12/20/2013 11:38 AM, Eelco Dolstra wrote:
> Hi,
>
> On 17/12/13 13:01, Rickard Nilsson wrote:
>
>> Is it possible to do the equivalence of nix-store --dump-db/--load-db
>> for a specific path, not the whole db? I know there is nix-store
>> --register-validity, but how do you create the input to that command for
>> an existing path?
>
> AFAIK, there is no command for that, but the format is pretty simple:
>
> <store path>
> <sha256 hash of the NAR in base-16>
> <size of the NAR (nix-store -q --size)>
> <deriver (can be empty>
> <number of references>
> <the references, one per line>
>
> You can omit the hash and the size if you're not passing the --hash-given flag.
Thanks! I should be able to whip up a prototype "nix-store --dump-db
<path>".
One more question, does "nix-store --load-db" replace the whole db with
the input, or just append? If it replaces the db, I probably need to use
"--register-validity" instead.
/ Rickard
More information about the nix-dev
mailing list