This reverts commit eabfb55de4.
The issues doesn't seem to be the number of generations,
but that nixos itself keeps all channels as gc roots.
This prevents proper cleanup of old channel data.
Nix adds errexit and failpipe.
Using head will end in 141 SIGPIPE, see: https://unix.stackexchange.com/a/580119/185477
I apply the workaround / fix as suggested on StackExchange.
That way the script runs and can execute the cleanup and diff.
No need for overlays.
Instead create own packages and call them via callPackage.
That will keep them simpler and allows dependency injection.
I can follow existing patterns from nixpkgs, etc.