This is the command to delete all generations (backup systems) older than 3 days
sudo nix-collect-garbage --delete-older-than 3d
(There seems to be none for keeping x generations? That would be way more useful for me)
How can I easily make this run on every update? I have automatic updates enabled in a separate updates.nix config
{ config, lib, pkgs, inputs, ... }:
{
system.autoUpgrade = {
enable = true;
flake = inputs.self.outPath;
flags = [
"nixpkgs"
"-L" # print build logs
];
dates = "19:00";
randomizedDelaySec = "45min";
};
}