[Nix-dev] garbage collection and nix-push

Michael Raskin 7c6f434c at mail.ru
Wed Oct 3 08:19:17 CEST 2012


>> I am not too familiar with precise nix-push inside. Does the idea of 
>> building a directory with symlinks of NARs (wo it depends on them all),
>> calling it something that includes current date, and removing 
>> 100-hour-old link sets in cron look hard ot easy to implement?
>
>That's the direction I was thinking in indeed.
>However, apart from using "find" on the store to find the nar outputs, I
>could not find an easy way.
>
>nix-push outputs all nar files into 1 directory.
>However, in the store, each file is in its own subdirectory and the name
>of that dir is not easily guessable.
>
>nix-push also outputs .narinfo files, but they don't contain info on
>that dirname either.

inotifywait /tmp/ -e create -r -m | grep --line-buffered create-nars.nix | sed -u -e 's/ CREATE //' | while read file; do cat $file; done > create-nars.nix

works even when nix-push finishes quickly. Now you can simply build
the create-nars.nix file.

Of course, you want to run nix-push with non-standard tmpdir to reduce 
impact (it is small, though) on other tmp-using processes.

Of course, if you look at it you will see that you can easily generate
such a file yourself and nix-build it.





More information about the nix-dev mailing list