NixOS: Difference between revisions

imported>Edrex
add command to set current generation as boot default
imported>YellowOnion
Line 201: Line 201:
# delete ALL previous generations - you can no longer rollback after running this
# delete ALL previous generations - you can no longer rollback after running this
$ nix-collect-garbage -d                       
$ nix-collect-garbage -d                       
</syntaxHighlight>
List generations:
<syntaxHighlight lang=shell>
# as root
$ nix-env --list-generations --profile /nix/var/nix/profiles/system
</syntaxHighlight>
Switch generations:
<syntaxHighlight lang=shell>
# as root switch to generation 204
$ nix-env --profile /nix/var/nix/profiles/system --switch-generation 204
</syntaxHighlight>
delete broken generation(s):
<syntaxHighlight lang=shell>
# as root delete broken generations 205 and 206
$ nix-env --profile /nix/var/nix/profiles/system --delete-generations 205 206
</syntaxHighlight>
</syntaxHighlight>