small section on nix garbage collection
This commit is contained in:
parent
226e86bfbd
commit
87ce378393
1 changed files with 28 additions and 0 deletions
28
COMMANDS.md
28
COMMANDS.md
|
|
@ -6,4 +6,32 @@ nix repl
|
||||||
|
|
||||||
# fenix src FUNC (maybe a different name then src?)
|
# fenix src FUNC (maybe a different name then src?)
|
||||||
fenix repl <<< ":e $FUNC"
|
fenix repl <<< ":e $FUNC"
|
||||||
|
|
||||||
|
# fenix clean
|
||||||
|
nix-store --gc # aka nixos-collect-garbage
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Notes
|
||||||
|
#### Useful Tricks
|
||||||
|
The path `/nix/var/nix/profiles/per-user/root/channels/` seems to be where
|
||||||
|
Nix clones the git repos for chosen channels. Could be useful instead
|
||||||
|
of querying `search.nixos.org`.
|
||||||
|
|
||||||
|
#### "Alias" Commands
|
||||||
|
The tool `nix-collect-garbage` (as per `man nix-collect garbage`):
|
||||||
|
> ...is mostly an alias of nix-store --gc ⟨../command-ref/nix-store/gc.md⟩.
|
||||||
|
> That is, it deletes all unreachable store objects ⟨../store/store-object.md⟩
|
||||||
|
> in the Nix store to clean up your system.
|
||||||
|
>
|
||||||
|
> However, it provides two additional options, --delete-old ⟨#opt-delete-old⟩
|
||||||
|
> and --delete-older-than ⟨#opt-delete-older-than⟩, which also delete
|
||||||
|
> old profiles ⟨../command-ref/files/profiles.md⟩, allowing potentially more
|
||||||
|
> store objects ⟨../store/store-object.md⟩ to be deleted because profiles are
|
||||||
|
> also garbage collection roots.
|
||||||
|
|
||||||
|
> These options are the equivalent of running nix-env --delete-generations
|
||||||
|
> ⟨../command-ref/nix-env/delete-generations.md⟩ with various augments on
|
||||||
|
> multiple profiles, prior to running nix-collect-garbage (or just nix-store --gc)
|
||||||
|
> without any flags.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue