hi everyone, i want to add more or less the following howto to the wiki. there is just one question remaining, which i'd like to sort out beforehand, namely what is the distinction between nix-store --add and nix-prefetch-url and the resulting store paths?
would anyone care to enlighten me? thanks, jonas to introduce a file into the nix store, you normally either use nix-store --add largefile or nix-prefetch-url file://$(pwd)/largefile but both procedures have the problem that they try to load the whole file into memory, which may fail if you have a large one. properly adding the file on your own is a three step procedure: 1. find the right store path: nix-store --print-fixed-path --recursive sha256 $(nix-hash --type \ sha256 --base32 largefile) largefile to get the path which nix-store --add would be using nix-store --print-fixed-path sha256 $(nix-hash --type sha256 \ --flat --base32 largefile) largefile 2. copy/move the file to this path (you have to remount the nix-store read-write) 3. register the file: nix-store --register-validity --reregister RET <store-path> RET RET 0 RET C-d what is unclear to me at this point is the distinction between the path, that nix-store --add uses, and the one of nix-prefetch-url. in a requireFile directive you need the nix-prefetch-url one. the one from nix-hash --type sha256 --flat --base32, which needs to be fed into nix-store without --recursive.
pgpnXedFT4MnB.pgp
Description: PGP signature
_______________________________________________ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev