arnaucube
arnaucube/configsPublic Self-hosted repository
configs/nixos/README.md
nixos/README.mdRaw
 1After nixos installation and config files in place, run the `../install-new-desktop.sh` script to put in place all the config files (vim,nvim,tmux,i3,etc)
 2
 3Go back to a previous generation:
 4```
 5# list stored generations
 6sudo nixos-rebuild list-generations
 7
 8# go to generation number 42
 9sudo nix-env --switch-generation 42 -p /nix/var/nix/profiles/system
10
11# use it
12sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch
13
14# go back to the latest generation (suppose is 84)
15sudo nix-env --switch-generation 82 -p /nix/var/nix/profiles/system
16
17# to quickly go back just one step:
18sudo nixos-rebuild rollback
19```
20
21From time to time run the following commands to remove stuff from old generations
22```
23# list old generations
24sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
25
26# remove old generations
27sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations 9 10 11 12 13 X...
28
29# remove old generations except the last 5 generations
30sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations +5
31
32
33# update
34`sudo nix-channel --update`
35`sudo nixos-rebuild switch`
36
37# to remove old programs
38nix-collect-garbage --delete-old
39```
40
41When stting up the config files in a system, remember to rename either the file `thinkpad-configuration.nix` or `surface-configuration.nix` files into `configuration.nix`.