[Nix-dev] nix push hard linking

Mathijs Kwik mathijs at bluescreen303.nl
Tue Sep 25 11:35:34 CEST 2012


Hi all,

I like keeping a few nix-push outputs around, so machines that have
older definitions can still install packages without building from
source.

With the new binary-cache stuff, this becomes even nicer, but I'm
struggling to find a way to do this without using too much disk space.

Currently, I just nix-push to /vol/nixchannel/version-20120915 and so
on and hardlink everything from there into /vol/nixchannel/all.
Every night, I remove old versions, and stat every file in "all",
check the number of links to it, and when it's only 1, remove it, as
it's no longer in any available version.

However, these nar files are also found in /nix/store, and they are
copied on every nix-push.
Would it be possible to have nix-push just hardlink to these files?
Or maybe even nicer, build the nix-push output as a derivation,
containing just symlinks to the nars.
My "all" directory can then also just contain symlinks to these, and I
can use normal garbage collection to remove old channel-outputs,
followed by a dead-link purge on "all".

Does hardlinking make sense for nix-push?
Is there a recipe for building nix-push's output as a derivation?
Or perhaps I should just look into hydra?

Thanks,
Mathijs


More information about the nix-dev mailing list