Skip to content

Instantly share code, notes, and snippets.

View MaxwellDupre's full-sized avatar

Mike cm MaxwellDupre

  • 16:49 (UTC)
View GitHub Profile
@MaxwellDupre
MaxwellDupre / trim-generations.sh
Last active October 7, 2026 21:14 — 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-generations> <keep-days> <profile> \n\n