forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
synopsis: "`nix copy` supports `--profile` and `--out-link`" | ||
prs: [11657] | ||
--- | ||
|
||
The `nix copy` command now has flags `--profile` and `--out-link`, similar to `nix build`. `--profile` makes a profile point to the | ||
top-level store path, while `--out-link` create symlinks to the top-level store paths. | ||
|
||
For example, when updating the local NixOS system profile from a NixOS system closure on a remote machine, instead of | ||
``` | ||
# nix copy --from ssh://server $path | ||
# nix build --profile /nix/var/nix/profiles/system $path | ||
``` | ||
you can now do | ||
``` | ||
# nix copy --from ssh://server --profile /nix/var/nix/profiles/system $path | ||
``` | ||
The advantage is that this avoids a time window where *path* is not a garbage collector root, and so could be deleted by a concurrent `nix store gc` process. |