Cleaning old packages
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
- [GUI](./configuration/GUI.md)
|
- [GUI](./configuration/GUI.md)
|
||||||
- [Home-manager](./configuration/hm.md)
|
- [Home-manager](./configuration/hm.md)
|
||||||
- [How to find new software and configure](./configuration/new.md)
|
- [How to find new software and configure](./configuration/new.md)
|
||||||
|
- [Cleaning old packages](./configuration/clean.md)
|
||||||
- [Building your own software](./build/index.md)
|
- [Building your own software](./build/index.md)
|
||||||
- [Dev shells](./build/devshell.md)
|
- [Dev shells](./build/devshell.md)
|
||||||
- [Packages](./build/packages.md)
|
- [Packages](./build/packages.md)
|
||||||
|
16
src/configuration/clean.md
Normal file
16
src/configuration/clean.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Cleaning old packages
|
||||||
|
|
||||||
|
By default, packages installed will be kept after each rebuild, even if they are not active anymore.
|
||||||
|
You can manually garbage collect with `nix-collect-garbage -d` to remove all the old generations.
|
||||||
|
|
||||||
|
One can however do this automatically using the following:
|
||||||
|
```nix
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
persistent = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 14d";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
This will check every week, and delete packages that aren't used that active, that also are older than 14 days.
|
||||||
|
If the timing of the check was missed, due to the system being powered down or similar, it will attempt at the closest time it can.
|
Reference in New Issue
Block a user