NixOS Generations Trimmer: Difference between revisions

imported>Nix
Page to help with generations cleanup
 
imported>Nix
m fix defaults help
Line 139: Line 139:


Usage:
Usage:
trim-generations.sh (defaults are: Keep-Gens=3 Keep-Days=0 Profile=user)
trim-generations.sh (defaults are: Keep-Gens=10 Keep-Days=7 Profile=user)


If you enter any parameters, you must enter all three.
If you enter any parameters, you must enter all three.
Line 161: Line 161:


## Defaults
## Defaults
keepGens=10; keepDays=7
keepGensDef=10; keepDaysDef=7
keepGens=$keepGensDef; keepDays=$keepDaysDef


## Usage
## Usage
usage () {
usage () {
     printf "Usage:\n\t trim-generations.sh (defaults are: Keep-Gens=$keepGens Keep-Days=$keepDays Profile=user)\n\n"
     printf "Usage:\n\t trim-generations.sh (defaults are: Keep-Gens=$keepGensDef Keep-Days=$keepDaysDef Profile=user)\n\n"
     printf "If you enter any parameters, you must enter all three.\n\n"
     printf "If you enter any parameters, you must enter all three.\n\n"
     printf "Example:\n\t trim-generations.sh 15 10 home-manager\n"
     printf "Example:\n\t trim-generations.sh 15 10 home-manager\n"