Updated/corrected section garbage collection
This commit is contained in:
parent
f022c41835
commit
5310716620
1 changed files with 9 additions and 3 deletions
12
README.md
12
README.md
|
|
@ -16,7 +16,7 @@ My NixOS configuration repository
|
|||
4. Apply changes: `sudo nixos-rebuild switch` and reboot
|
||||
5. Clone NixOS config repository to /home/$USER/nixos:
|
||||
```
|
||||
cd
|
||||
cd $HOME
|
||||
git clone https://git.plueschbit.de/jan/nixos-conf ~/nixos
|
||||
```
|
||||
6. Add the new host to repository
|
||||
|
|
@ -29,6 +29,7 @@ git clone https://git.plueschbit.de/jan/nixos-conf ~/nixos
|
|||
## Update Packages on a Host
|
||||
Update of the file `flake.nix`:
|
||||
```
|
||||
cd ~/nixos
|
||||
sudo nix flake update
|
||||
```
|
||||
Then, perform nixos rebuild:
|
||||
|
|
@ -37,8 +38,13 @@ sudo nixos-rebuild switch --flake ~/nixos/#<host>
|
|||
```
|
||||
|
||||
## Garbage Collection
|
||||
List all generations:
|
||||
```
|
||||
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
|
||||
```
|
||||
|
||||
Keep e.g. the last five generations and perform garbage collection:
|
||||
```
|
||||
sudo nix-env --delete-generations +5
|
||||
sudo nix-store --gc
|
||||
sudo nix-env --delete-generations +5 --profile /nix/var/nix/profiles/system
|
||||
sudo nix-collect-garbage
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue