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

Domen Kožar domen at dev.si
Thu Mar 30 16:03:40 CEST 2017


https://github.com/NixOS/nix/pull/767

On Thu, Mar 30, 2017 at 4:01 PM, Profpatsch <mail at profpatsch.de> wrote:

> On 17-03-30 02:42pm, 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 ?
>
> Remove all system links from /nix/var/nix/profiles that you don’t want
>     for i in $(seq 100 142); do rm "/nix/var/nix/profiles/system-$i-link";
> done
>
> Then perform a garbage collection
>     nix-store --gc
>
> This works for all kinds of profiles (e.g. the result link from nix-build).
>
> --
> Proudly written in Mutt with Vim on NixOS.
> Q: Why is this email five sentences or less?
> A: http://five.sentenc.es
> May take up to five days to read your message. If it’s urgent, call me.
> _______________________________________________
> 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/b20b8417/attachment.html>


More information about the nix-dev mailing list