[Nix-dev] garbage-collection of the last 'n' generations

Guillaume Maudoux (Layus) layus.on at gmail.com
Thu Mar 30 16:11:32 CEST 2017


Your system generations are under /nix/var/nix/profiles.

You can `rm -i $(cd /nix/var/nix/profiles; ls *-link -1dtr | head -n -<# 
of versions to to keep> | grep -v $(readlink system) | xargs realpath 
-s)` :-)

and then do a normal gc.

-- Layus.

On 30/03/17 15:42, Azul wrote:
>
> Hi there,
>
> I would like to cleanup my oldest  'n' nix generations.
>
> nix-collect-garbage seems to only provide me with a older than 'n' 
> days option.
>
> Any quick hacks to clean everything but keep my recent  'n' generations ?
>
>
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170330/cb8114fa/attachment.html>


More information about the nix-dev mailing list