Add home-manager cleanup cronjob
This commit is contained in:
parent
7977281efc
commit
322b19b3c6
2 changed files with 19 additions and 0 deletions
home-manager
|
@ -26,6 +26,15 @@
|
|||
sessionPath = [ "$HOME/.local/bin" ];
|
||||
};
|
||||
|
||||
# Clean up all but the most recent 5 home-manager configs
|
||||
services.cron = {
|
||||
enable = true;
|
||||
crontab = ''
|
||||
# Cleanup all but last 5 home-manager generations weekly on Sunday at midnight
|
||||
0 0 * * 0 home-manager generations | tail -n +6 | awk '{print $5}' | xargs -I {} home-manager remove-generations {}
|
||||
'';
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
# Currently in use in the Firefox config
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
sessionPath = [ "$HOME/.local/bin" ];
|
||||
};
|
||||
|
||||
# Clean up all but the most recent 2 home-manager configs
|
||||
services.cron = {
|
||||
enable = true;
|
||||
crontab = ''
|
||||
# Cleanup all but last 5 home-manager generations weekly on Sunday at midnight
|
||||
0 0 * * 0 home-manager generations | tail -n +3 | awk '{print $5}' | xargs -I {} home-manager remove-generations {}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
# Currently in use in the Firefox config
|
||||
|
|
Loading…
Add table
Reference in a new issue