[Nix-dev] Gratuitous generations

Christian Theune ct at flyingcircus.io
Tue Mar 31 21:56:30 CEST 2015


Hi,

> On 30 Mar 2015, at 15:07, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> 
> We could add an option to suppress creating a new generation if nothing has changed.

I read some code and I have a suggestion - tell me if I’m missing something obvious, because this looks really simple.

In createGeneration we already look at the existing generations
https://github.com/NixOS/nix/blob/master/src/nix-env/profiles.cc#L77 <https://github.com/NixOS/nix/blob/master/src/nix-env/profiles.cc#L77>

Looking at the generation links, I can see this in my profiles directory:

lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:15 default-30-link -> /nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment
lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:16 default-31-link -> /nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment
lrwxr-xr-x   1 ctheune  wheel    60B Mar 17 17:16 default-32-link -> /nix/store/ywgj0k27h2c6ly7l40afbqxncis858c1-user-environment

So. How about adapting createGeneration to not create a new generation if it targets the same environment as the previous one? Maybe with an option?

Would this be the right point to change this? Am I missing something? Looks quite simple to me (minus my C++ writing abilities being basically nonexisting).

If this path looks OK to you then I’d be happy to bash my head against the C++ to learn something.

Christian

—
Christian Theune · ct at flyingcircus.io · +49 345 219401 0
Flying Circus Internet Operations GmbH · http://flyingcircus.io
Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
HR Stendal HRB 21169 · Geschäftsführer: Christian. Theune, Christian. Zagrodnick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150331/e246845d/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150331/e246845d/attachment-0001.bin 


More information about the nix-dev mailing list