mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Enable lazy/sparse allocation of generation symlinks: avoid creating
new generations if a generation already exists. Alternatively or additionally I propose a mode where only the *last* generation will be sparse.
This commit is contained in:
parent
be1ff23352
commit
3d83188702
2 changed files with 25 additions and 1 deletions
|
@ -99,6 +99,15 @@ if nix-env -q '*' | grep -q bar; then false; fi
|
|||
nix-env --list-generations
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 7
|
||||
|
||||
# Doing the same operation twice should result in the same generation, not an
|
||||
# additional one. At this point we just brought back foo. Installing it again
|
||||
# should not create a new generation.
|
||||
nix-env -i foo
|
||||
|
||||
# Count generations.
|
||||
nix-env --list-generations
|
||||
test "$(nix-env --list-generations | wc -l)" -eq 7
|
||||
|
||||
# Switch to a specified generation.
|
||||
nix-env --switch-generation 7
|
||||
[ "$(nix-store -q --resolve $profiles/test)" = "$oldGen" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue