This commit is contained in:
parent
76c3ae1cef
commit
ed1668704e
|
@ -21,6 +21,21 @@ sub closure : Chained('nix') PathPart {
|
|||
sub manifest : Chained('nix') PathPart Args(0) {
|
||||
my ($self, $c) = @_;
|
||||
$c->stash->{current_view} = 'Hydra::View::NixManifest';
|
||||
$c->stash->{narBase} = $c->uri_for($self->action_for("nar"), $c->req->captures);
|
||||
}
|
||||
|
||||
|
||||
sub nar : Chained('nix') PathPart {
|
||||
my ($self, $c, @rest) = @_;
|
||||
|
||||
my $path .= "/" . join("/", @rest);
|
||||
|
||||
error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
|
||||
|
||||
# !!! check that $path is in the closure of $c->stash->{storePaths}.
|
||||
|
||||
$c->stash->{current_view} = 'Hydra::View::NixNAR';
|
||||
$c->stash->{storePath} = $path;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -562,18 +562,6 @@ sub nixpkg :Local {
|
|||
}
|
||||
|
||||
|
||||
sub nar :Local {
|
||||
my ($self, $c, @rest) = @_;
|
||||
|
||||
my $path .= "/" . join("/", @rest);
|
||||
|
||||
error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
|
||||
|
||||
$c->stash->{current_view} = 'Hydra::View::NixNAR';
|
||||
$c->stash->{storePath} = $path;
|
||||
}
|
||||
|
||||
|
||||
sub end : ActionClass('RenderView') {
|
||||
my ($self, $c) = @_;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ sub process {
|
|||
or die "cannot query hash of `$path': $?";
|
||||
chomp $hash;
|
||||
|
||||
my $url = $c->uri_for('/nar' . $path);
|
||||
my $url = $c->stash->{narBase} . $path;
|
||||
|
||||
my $deriver = `nix-store --query --deriver $path`
|
||||
or die "cannot query deriver of `$path': $?";
|
||||
|
|
Loading…
Reference in a new issue