Skip to content

Instantly share code, notes, and snippets.

View MaxwellDupre's full-sized avatar

Mike cm MaxwellDupre

View GitHub Profile
@MaxwellDupre
MaxwellDupre / trim-generations.sh
Last active April 1, 2024 02:46 — forked from Bondrake/trim-generations.sh
NixOS script to keep 30 generations or 30 days, whichever is greater (configurable, profile is selectable)
#!/usr/bin/env bash
set -euo pipefail
## Defaults
keepGensDef=30; keepDaysDef=30
keepGens=$keepGensDef; keepDays=$keepDaysDef
## Usage
usage () {
printf "Usage:\n\t ./trim-generations.sh <keep-gernerations> <keep-days> <profile> \n\n