[Nix-dev] Git commit hashes

Vladimír Čunát vcunat at gmail.com
Tue Jun 2 21:24:52 CEST 2015


On 06/02/2015 08:54 PM, Colin Putney wrote:
> Not using fetchgit, since the nix expressions are part of the code.
> Passing the commit hash into the script would require wrapping all my
> build commands. Not sure how that would work with nixops. That might be
> the best option, though. Thanks!

If you use src = ./.; or something like that, you likely have .git
directory accessible to your builder already. With that you can do
whatever you need.

Nixos needs the version accessible also as a nix value (i.e. during
*.nix evaluation already), so it needs to export the sha into a file
before running nix and just read the file (nixos-rebuild takes care of
that).


Vladimir


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3251 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150602/8237e241/attachment.bin 


More information about the nix-dev mailing list