.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-store-prefetch-file" "1" "" .RS .PP \fBWarning\fR .br This program is \fB\fBexperimental\fR\fR and its interface is subject to change. .RE .SH Name .LP \fCnix store prefetch-file\fR - download a file into the Nix store .SH Synopsis .LP \fCnix store prefetch-file\fR [\fIoption\fR\[u2026]] \fIurl\fR .SH Examples .IP "\(bu" 3 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" 3 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 .LP 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" 3 \fB\fC--executable\fR\fR .IP 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" 3 \fB\fC--expected-hash\fR\fR \fIhash\fR .IP The expected hash of the file. .IP "\(bu" 3 \fB\fC--hash-type\fR\fR \fIhash-algo\fR .IP Hash algorithm (\fCmd5\fR, \fCsha1\fR, \fCsha256\fR, or \fCsha512\fR). .IP "\(bu" 3 \fB\fC--json\fR\fR .IP Produce output in JSON format, suitable for consumption by another program. .IP "\(bu" 3 \fB\fC--name\fR\fR \fIname\fR .IP Override the name component of the resulting store path. It defaults to the base name of \fIurl\fR. .IP "\(bu" 3 \fB\fC--unpack\fR\fR .IP Unpack the archive (which must be a tarball or zip file) and add the result to the Nix store. .SS Logging-related options .IP "\(bu" 3 \fB\fC--debug\fR\fR .IP Set the logging verbosity level to \(oqdebug\(cq. .IP "\(bu" 3 \fB\fC--log-format\fR\fR \fIformat\fR .IP Set the format of log output; one of \fCraw\fR, \fCinternal-json\fR, \fCbar\fR or \fCbar-with-logs\fR. .IP "\(bu" 3 \fB\fC--print-build-logs\fR\fR / \fC-L\fR .IP Print full build logs on standard error. .IP "\(bu" 3 \fB\fC--quiet\fR\fR .IP Decrease the logging verbosity level. .IP "\(bu" 3 \fB\fC--verbose\fR\fR / \fC-v\fR .IP Increase the logging verbosity level. .SS Miscellaneous global options .IP "\(bu" 3 \fB\fC--help\fR\fR .IP Show usage information. .IP "\(bu" 3 \fB\fC--offline\fR\fR .IP Disable substituters and consider all previously downloaded files up-to-date. .IP "\(bu" 3 \fB\fC--option\fR\fR \fIname\fR \fIvalue\fR .IP Set the Nix configuration setting \fIname\fR to \fIvalue\fR (overriding \fCnix.conf\fR). .IP "\(bu" 3 \fB\fC--refresh\fR\fR .IP Consider all previously downloaded files out-of-date. .IP "\(bu" 3 \fB\fC--version\fR\fR .IP Show version information. .RS .LP \fBNote\fR .PP See \fB\fCman nix.conf\fR\fR for overriding configuration settings with command line flags. .RE