Remove nix-install-package support
'nix-install-package' no longer exists in Nix 1.12. Closes #268.
This commit is contained in:
parent
a4fc292c83
commit
fd463ff403
|
@ -78,27 +78,6 @@ sub manifest : Chained('nix') PathPart("MANIFEST") Args(0) {
|
|||
}
|
||||
|
||||
|
||||
sub pkg : Chained('nix') PathPart Args(1) {
|
||||
my ($self, $c, $pkgName) = @_;
|
||||
|
||||
if (!$c->stash->{build}) {
|
||||
$pkgName =~ /-(\d+)\.nixpkg$/ or notFound($c, "Bad package name.");
|
||||
# FIXME: need to handle multiple outputs: channelBuilds is
|
||||
# joined with the build outputs, so find() can return multiple
|
||||
# results.
|
||||
$c->stash->{build} = $c->stash->{channelBuilds}->find({ id => $1 })
|
||||
|| notFound($c, "No such package in this channel.");
|
||||
}
|
||||
|
||||
gone($c, "Build " . $c->stash->{build}->id . " is no longer available.")
|
||||
if isLocalStore() && any { !isValidPath($_->path) } $c->stash->{build}->buildoutputs->all;
|
||||
|
||||
$c->stash->{current_view} = 'NixPkg';
|
||||
|
||||
$c->response->content_type('application/nix-package');
|
||||
}
|
||||
|
||||
|
||||
sub nixexprs : Chained('nix') PathPart('nixexprs.tar.bz2') Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
requireLocalStore($c);
|
||||
|
|
|
@ -121,6 +121,8 @@ sub build_GET {
|
|||
$c->stash->{constituents} = [$build->constituents_->search({}, {order_by => ["job"]})];
|
||||
|
||||
$c->stash->{steps} = [$build->buildsteps->search({}, {order_by => "stepnr desc"})];
|
||||
|
||||
$c->stash->{binaryCachePublicUri} = $c->config->{binary_cache_public_uri};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
package Hydra::View::NixPkg;
|
||||
|
||||
use strict;
|
||||
use base qw/Catalyst::View/;
|
||||
use Hydra::Helper::CatalystUtils;
|
||||
|
||||
sub process {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
$c->response->content_type('application/nix-package');
|
||||
|
||||
my $build = $c->stash->{build};
|
||||
|
||||
my $channelUri = $c->config->{binary_cache_public_uri} // $c->uri_for('/');
|
||||
|
||||
# FIXME: add multiple output support
|
||||
my $s = "NIXPKG1 http://invalid.org/"
|
||||
. " " . $build->nixname . " " . $build->system
|
||||
. " " . $build->drvpath . " " . $build->buildoutputs->find({name => "out"})->path
|
||||
. " " . $channelUri;
|
||||
|
||||
$c->response->body($s);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
|
@ -24,11 +24,6 @@ $ nix-env -u '*'</pre>
|
|||
|
||||
[% IF genericChannel %]
|
||||
|
||||
<p>Alternatively, if you have associated the
|
||||
<tt>application/nix-package</tt> MIME type with the
|
||||
<tt>nix-install-package</tt> program in your web browser, you can
|
||||
install the package simply by clicking on the packages below.</p>
|
||||
|
||||
<h2>Packages</h2>
|
||||
|
||||
<p>This channel contains the following packages.</p>
|
||||
|
@ -49,11 +44,10 @@ install the package simply by clicking on the packages below.</p>
|
|||
[% FOREACH pkg IN nixPkgs %]
|
||||
|
||||
[% b = pkg.build %]
|
||||
[% uri = "${curUri}/pkg/${pkg.name}.nixpkg" %]
|
||||
|
||||
<tr>
|
||||
<td><a href="[% c.uri_for('/build' b.id) %]">[% b.id %]</a></td>
|
||||
<td><a class="row-link" href="[% uri %]"><tt>[% b.get_column('releasename') || b.nixname %]</tt></a></td>
|
||||
<td><tt>[% b.get_column('releasename') || b.nixname %]</tt></td>
|
||||
<td><tt>[% b.system %]</tt></td>
|
||||
<td>
|
||||
[% IF b.homepage %]
|
||||
|
|
|
@ -71,29 +71,17 @@
|
|||
<img src="[% c.uri_for("/static/images/nix-build.png") %]" alt="Source" />
|
||||
</td>
|
||||
<td>
|
||||
One-Click install
|
||||
Nix package
|
||||
</td>
|
||||
<td>
|
||||
[% uri = c.uri_for('/build' build.id 'nix' 'pkg' "${build.nixname}-${build.system}.nixpkg") %]
|
||||
<a href="[% uri %]">
|
||||
<tt>[% build.nixname %]</tt>
|
||||
</a>
|
||||
<tt>[% HTML.escape(build.nixname) %]</tt>
|
||||
</td>
|
||||
<td>
|
||||
[% WRAPPER makePopover title="Help" classes="btn-mini" %]
|
||||
<p>If you have Nix installed on your machine, you can
|
||||
install this package and all its dependencies automatically
|
||||
by clicking on the link above. This requires that you have
|
||||
the <tt>application/nix-package</tt> MIME type associated
|
||||
with the <tt>nix-install-package</tt> program in your web
|
||||
browser. Alternatively, you can install it from the
|
||||
command-line:</p>
|
||||
[% WRAPPER makePopover title="Help" classes="btn-mini"
|
||||
%] <p>Yu can install this package using the Nix package
|
||||
manager from the command-line:</p>
|
||||
|
||||
<pre><span class="shell-prompt">$ </span>nix-install-package --non-interactive --url [% uri %]</pre>
|
||||
|
||||
<p>If you get an error message “Permission denied”, you
|
||||
should make sure that you have sufficient access rights to
|
||||
the Nix store, e.g., run the command as <tt>root</tt>.</p>
|
||||
<pre><span class="shell-prompt">$ </span>nix-env -i [%HTML.escape(product.path)%][% IF binaryCachePublicUri %] --option binary-caches [% HTML.escape(binaryCachePublicUri) %][% END %]</pre>
|
||||
[% END %]
|
||||
[% IF localStore %]
|
||||
<a class="btn btn-mini" href="[% contents %]">Contents</a>
|
||||
|
|
Loading…
Reference in a new issue