.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-store-prefetch-file" "1" "" .PP \fBWarning\fR: This program is \fBexperimental\fR and its interface is subject to change. .SH Name \fCnix store prefetch-file\fR - download a file into the Nix store .SH Synopsis \fCnix store prefetch-file\fR [\fIoption\fR\[u2026]] \fIurl\fR .SH Examples .IP "\(bu" 2 Download a file to the Nix store: .LP .EX # nix store prefetch-file https://releases.nixos.org/nix/nix-2.3.10/nix-2.3.10.tar.xz Downloaded 'https://releases.nixos.org/nix/nix-2.3.10/nix-2.3.10.tar.xz' to \&'/nix/store/vbdbi42hgnc4h7pyqzp6h2yf77kw93aw-source' (hash \&'sha256-qKheVd5D0BervxMDbt+1hnTKE2aRWC8XCAwc0SeHt6s='). .EE .IP "\(bu" 2 Download a file and get the SHA-512 hash: .LP .EX # nix store prefetch-file --json --hash-type sha512 \e https://releases.nixos.org/nix/nix-2.3.10/nix-2.3.10.tar.xz \e | jq -r .hash sha512-6XJxfym0TNH9knxeH4ZOvns6wElFy3uahunl2hJgovACCMEMXSy42s69zWVyGJALXTI+86tpDJGlIcAySEKBbA== .EE .SH Description This command downloads the file \fIurl\fR to the Nix store. It prints out the resulting store path and the cryptographic hash of the contents of the file. .PP The name component of the store path defaults to the last component of \fIurl\fR, but this can be overridden using \fC--name\fR. .SH Options .IP "\(bu" 2 \fC--executable\fR .br Make the resulting file executable. Note that this causes the resulting hash to be a NAR hash rather than a flat file hash. .IP "\(bu" 2 \fC--expected-hash\fR \fIhash\fR .br The expected hash of the file. .IP "\(bu" 2 \fC--hash-type\fR \fIhash-algo\fR .br hash algorithm (\[u2018]md5\[u2019], \[u2018]sha1\[u2019], \[u2018]sha256\[u2019], or \[u2018]sha512\[u2019]) .IP "\(bu" 2 \fC--json\fR .br Produce output in JSON format, suitable for consumption by another program. .IP "\(bu" 2 \fC--name\fR \fIname\fR .br Override the name component of the resulting store path. It defaults to the base name of \fIurl\fR.