[Nix-dev] Git commit hashes

Colin Putney colin at wiresong.com
Wed Jun 3 00:19:39 CEST 2015


On Tue, Jun 2, 2015 at 12:24 PM, Vladimír Čunát <vcunat at gmail.com> wrote:

> 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).
>

Ah, very helpful, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150602/5a4e667d/attachment-0001.html 


More information about the nix-dev mailing list