"Reproduce" action: Support flakes

No more need for a reproduction script! It just says something like

  If you have Nix installed, you can reproduce this build on your own
  machine by running the following command:

  # nix build github:edolstra/dwarffs/09c823e977946668b63ad6c88ed358b48220f124:hydraJobs.build.x86_64-linux
This commit is contained in:
Eelco Dolstra 2019-05-11 00:52:25 +02:00
parent 4ec51032ee
commit f68cb7b57e
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -120,7 +120,7 @@ END;
<b class="caret"></b> <b class="caret"></b>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
[% IF build.nixexprinput %] [% IF build.nixexprinput || eval.flake %]
<li><a href="#reproduce" data-toggle="modal">Reproduce locally</a></li> <li><a href="#reproduce" data-toggle="modal">Reproduce locally</a></li>
[% END %] [% END %]
[% IF c.user_exists %] [% IF c.user_exists %]
@ -532,18 +532,33 @@ END;
<div class="modal-body"> <div class="modal-body">
<p>You can reproduce this build on your own machine by downloading [% IF eval.flake %]
<a [% HTML.attributes(href => url) %]>a script</a> that checks out
all inputs of the build and then invokes Nix to perform the build. <p>If you have <a href='https://nixos.org/nix/download.html'>Nix
This script requires that you have Nix on your system.</p> installed</a>, you can reproduce this build on your own machine by
running the following command:</p>
<pre>
<span class="shell-prompt"># </span>nix build [% HTML.escape(eval.flake) %]:hydraJobs.[% HTML.escape(job.name) %]
</pre>
[% ELSE %]
<p>If you have <a href='https://nixos.org/nix/download.html'>Nix
installed</a>, you can reproduce this build on your own machine by
downloading <a [% HTML.attributes(href => url) %]>a script</a>
that checks out all inputs of the build and then invokes Nix to
perform the build.</p>
<p>To download and execute the script from the command line, run the <p>To download and execute the script from the command line, run the
following command:</p> following command:</p>
<pre> <pre>
<span class="shell-prompt">$ </span>curl <a [% HTML.attributes(href => url) %]>[% HTML.escape(url) %]</a> | bash <span class="shell-prompt"># </span>curl <a [% HTML.attributes(href => url) %]>[% HTML.escape(url) %]</a> | bash
</pre> </pre>
[% END %]
</div> </div>
<div class="modal-footer"> <div class="modal-footer">