.\" -*- 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 \f(CRnix store prefetch-file\fR - download a file into the Nix store .SH Synopsis .LP \f(CRnix 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 \f(CR--name\fR. .SH Options .IP "\(bu" 3 \fB\f(CR--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\f(CR--expected-hash\fR\fR \fIhash\fR .IP The expected hash of the file. .IP "\(bu" 3 \fB\f(CR--hash-type\fR\fR \fIhash-algo\fR .IP Hash algorithm (\f(CRmd5\fR, \f(CRsha1\fR, \f(CRsha256\fR, or \f(CRsha512\fR). .IP "\(bu" 3 \fB\f(CR--json\fR\fR .IP Produce output in JSON format, suitable for consumption by another program. .IP "\(bu" 3 \fB\f(CR--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\f(CR--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\f(CR--debug\fR\fR .IP Set the logging verbosity level to \(oqdebug\(cq. .IP "\(bu" 3 \fB\f(CR--log-format\fR\fR \fIformat\fR .IP Set the format of log output; one of \f(CRraw\fR, \f(CRinternal-json\fR, \f(CRbar\fR or \f(CRbar-with-logs\fR. .IP "\(bu" 3 \fB\f(CR--print-build-logs\fR\fR / \f(CR-L\fR .IP Print full build logs on standard error. .IP "\(bu" 3 \fB\f(CR--quiet\fR\fR .IP Decrease the logging verbosity level. .IP "\(bu" 3 \fB\f(CR--verbose\fR\fR / \f(CR-v\fR .IP Increase the logging verbosity level. .SS Miscellaneous global options .IP "\(bu" 3 \fB\f(CR--help\fR\fR .IP Show usage information. .IP "\(bu" 3 \fB\f(CR--offline\fR\fR .IP Disable substituters and consider all previously downloaded files up-to-date. .IP "\(bu" 3 \fB\f(CR--option\fR\fR \fIname\fR \fIvalue\fR .IP Set the Nix configuration setting \fIname\fR to \fIvalue\fR (overriding \f(CRnix.conf\fR). .IP "\(bu" 3 \fB\f(CR--refresh\fR\fR .IP Consider all previously downloaded files out-of-date. .IP "\(bu" 3 \fB\f(CR--version\fR\fR .IP Show version information. .RS .LP \fBNote\fR .PP See \fB\f(CRman nix.conf\fR\fR for overriding configuration settings with command line flags. .RE