.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-copy" "1" "" .PP \fBWarning\fR: This program is \fBexperimental\fR and its interface is subject to change. .SH Name \fCnix copy\fR - copy paths between Nix stores .SH Synopsis \fCnix copy\fR [\fIoption\fR\[u2026]] \fIinstallables\fR\[u2026] .SH Examples .IP "\(bu" 2 Copy Firefox from the local store to a binary cache in \fC/tmp/cache\fR: .LP .EX # nix copy --to file:///tmp/cache $(type -p firefox) .EE .IP Note the \fCfile://\fR - without this, the destination is a chroot store, not a binary cache. .IP "\(bu" 2 Copy the entire current NixOS system closure to another machine via SSH: .LP .EX # nix copy -s --to ssh://server /run/current-system .EE .IP The \fC-s\fR flag causes the remote machine to try to substitute missing store paths, which may be faster if the link between the local and remote machines is slower than the link between the remote machine and its substituters (e.g. \fChttps://cache.nixos.org\fR). .IP "\(bu" 2 Copy a closure from another machine via SSH: .LP .EX # nix copy --from ssh://server /nix/store/a6cnl93nk1wxnq84brbbwr6hxw9gp2w9-blender-2.79-rc2 .EE .IP "\(bu" 2 Copy Hello to a binary cache in an Amazon S3 bucket: .LP .EX # nix copy --to s3://my-bucket?region=eu-west-1 nixpkgs#hello .EE .IP or to an S3-compatible storage system: .LP .EX # nix copy --to s3://my-bucket?region=eu-west-1&endpoint=example.com nixpkgs#hello .EE .IP Note that this only works if Nix is built with AWS support. .IP "\(bu" 2 Copy a closure from \fC/nix/store\fR to the chroot store \fC/tmp/nix/nix/store\fR: .LP .EX # nix copy --to /tmp/nix nixpkgs#hello --no-check-sigs .EE .SH Description \fCnix copy\fR copies store path closures between two Nix stores. The source store is specified using \fC--from\fR and the destination using \fC--to\fR. If one of these is omitted, it defaults to the local store. .SH Options .IP "\(bu" 2 \fC--from\fR \fIstore-uri\fR .br URL of the source Nix store. .IP "\(bu" 2 \fC--no-check-sigs\fR .br Do not require that paths are signed by trusted keys. .IP "\(bu" 2 \fC--substitute-on-destination\fR / \fC-s\fR .br Whether to try substitutes on the destination store (only supported by SSH stores). .IP "\(bu" 2 \fC--to\fR \fIstore-uri\fR .br URL of the destination Nix store. .LP \fBCommon evaluation options:\fR .IP "\(bu" 2 \fC--arg\fR \fIname\fR \fIexpr\fR .br Pass the value \fIexpr\fR as the argument \fIname\fR to Nix functions. .IP "\(bu" 2 \fC--argstr\fR \fIname\fR \fIstring\fR .br Pass the string \fIstring\fR as the argument \fIname\fR to Nix functions. .IP "\(bu" 2 \fC--eval-store\fR \fIstore-url\fR .br The Nix store to use for evaluations. .IP "\(bu" 2 \fC--impure\fR .br Allow access to mutable paths and repositories. .IP "\(bu" 2 \fC--include\fR / \fC-I\fR \fIpath\fR .br Add \fIpath\fR to the list of locations used to look up \fC<...>\fR file names. .IP "\(bu" 2 \fC--override-flake\fR \fIoriginal-ref\fR \fIresolved-ref\fR .br Override the flake registries, redirecting \fIoriginal-ref\fR to \fIresolved-ref\fR. .LP \fBCommon flake-related options:\fR .IP "\(bu" 2 \fC--commit-lock-file\fR .br Commit changes to the flake\[u2019]s lock file. .IP "\(bu" 2 \fC--inputs-from\fR \fIflake-url\fR .br Use the inputs of the specified flake as registry entries. .IP "\(bu" 2 \fC--no-registries\fR .br Don\[u2019]t allow lookups in the flake registries. This option is deprecated; use \fC--no-use-registries\fR. .IP "\(bu" 2 \fC--no-update-lock-file\fR .br Do not allow any updates to the flake\[u2019]s lock file. .IP "\(bu" 2 \fC--no-write-lock-file\fR .br Do not write the flake\[u2019]s newly generated lock file. .IP "\(bu" 2 \fC--override-input\fR \fIinput-path\fR \fIflake-url\fR .br Override a specific flake input (e.g. \fCdwarffs/nixpkgs\fR). This implies \fC--no-write-lock-file\fR. .IP "\(bu" 2 \fC--recreate-lock-file\fR .br Recreate the flake\[u2019]s lock file from scratch. .IP "\(bu" 2 \fC--update-input\fR \fIinput-path\fR .br Update a specific flake input (ignoring its previous entry in the lock file). .LP \fBOptions that change the interpretation of installables:\fR .IP "\(bu" 2 \fC--all\fR .br Apply the operation to every store path. .IP "\(bu" 2 \fC--derivation\fR .br Operate on the store derivation rather than its outputs. .IP "\(bu" 2 \fC--expr\fR \fIexpr\fR .br Interpret installables as attribute paths relative to the Nix expression \fIexpr\fR. .IP "\(bu" 2 \fC--file\fR / \fC-f\fR \fIfile\fR .br Interpret installables as attribute paths relative to the Nix expression stored in \fIfile\fR. If \fIfile\fR is the character -, then a Nix expression will be read from standard input. .IP "\(bu" 2 \fC--no-recursive\fR .br Apply operation to specified paths only.