.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-store-add" "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 add\fR - Add a file or directory to the Nix store .SH Synopsis .LP \f(CRnix store add\fR [\fIoption\fR\[u2026]] \fIpath\fR .SH Description .LP Copy \fIpath\fR to the Nix store, and print the resulting store path on standard output. .RS .PP \fBWarning\fR .PP The resulting store path is not registered as a garbage collector root, so it could be deleted before you have a chance to register it. .RE .SH Examples .LP Add a directory to the store: .LP .EX # mkdir dir # echo foo > dir/bar # nix store add ./dir /nix/store/6pmjx56pm94n66n4qw1nff0y1crm8nqg-dir # cat /nix/store/6pmjx56pm94n66n4qw1nff0y1crm8nqg-dir/bar foo .EE .SH Options .IP "\(bu" 3 \fB\f(CR--dry-run\fR\fR .IP Show what this command would do without doing it. .IP "\(bu" 3 \fB\f(CR--hash-algo\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--mode\fR\fR \fIcontent-address-method\fR .IP How to compute the content-address of the store object. One of: .RS .IP "\(bu" 3 \fB\f(CRnar\fR\fR (the default): Serialises the input as a \fBNix Archive\fR and passes that to the hash function. .IP "\(bu" 3 \fB\f(CRflat\fR\fR: Assumes that the input is a single file and \fBdirectly passes\fR it to the hash function. .IP "\(bu" 3 \fB\f(CRtext\fR\fR: Like \f(CRflat\fR, but used for \fBderivations\fR serialized in store object and \fB\f(CRbuiltins.toFile\fR\fR. For advanced use-cases only; for regular usage prefer \f(CRnar\fR and \f(CRflat\fR. .RE .IP "\(bu" 3 \fB\f(CR--name\fR\fR / \f(CR-n\fR \fIname\fR .IP Override the name component of the store path. It defaults to the base name of \fIpath\fR. .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