Remove nix-install-package support

'nix-install-package' no longer exists in Nix 1.12.

Closes #268.
This commit is contained in:
Eelco Dolstra
2018-01-15 14:27:58 +01:00
parent a4fc292c83
commit fd463ff403
5 changed files with 9 additions and 73 deletions

View File

@ -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);

View File

@ -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};
}

View File

@ -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;