cleanup script
This commit is contained in:
@@ -87,6 +87,19 @@
|
|||||||
${echoCmd} "Testing the evaulation of the nixos config for $HOSTNAME"
|
${echoCmd} "Testing the evaulation of the nixos config for $HOSTNAME"
|
||||||
${lib.getExe nix} eval ${flakeDir}#nixosConfigurations.$HOSTNAME.config.system.build.toplevel.drvPath
|
${lib.getExe nix} eval ${flakeDir}#nixosConfigurations.$HOSTNAME.config.system.build.toplevel.drvPath
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
(writeShellScriptBin "cleanup" ''
|
||||||
|
set -e
|
||||||
|
DAYS=$1
|
||||||
|
if [ -z "$DAYS" ]; then
|
||||||
|
${echoCmd} "usage: cleanup <days>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${lib.getExe home-manager} expire-generations "-$DAYS days"
|
||||||
|
${lib.getExe nix} profile wipe-history --older-than "''${DAYS}d"
|
||||||
|
${lib.getExe nix} store gc
|
||||||
|
${lib.getExe nix} store optimise
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user