Add a binary-cache-url file to channels to advertise the binary cache URL
This commit is contained in:
parent
fad2a084fa
commit
13688e364f
|
@ -86,6 +86,14 @@ sub nixexprs : Chained('nix') PathPart('nixexprs.tar.bz2') Args(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub binary_cache_url : Chained('nix') PathPart('binary-cache-url') Args(0) {
|
||||||
|
my ($self, $c) = @_;
|
||||||
|
$c->stash->{'plain'} = { data => $c->uri_for('/') };
|
||||||
|
$c->header('Content-Type' => 'text/plain');
|
||||||
|
$c->forward('Hydra::View::Plain');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub name {
|
sub name {
|
||||||
my ($build) = @_;
|
my ($build) = @_;
|
||||||
return $build->releasename || $build->nixname;
|
return $build->releasename || $build->nixname;
|
||||||
|
|
|
@ -198,6 +198,7 @@ sub nar :Local :Args(1) {
|
||||||
|
|
||||||
sub nix_cache_info :Path('nix-cache-info') :Args(0) {
|
sub nix_cache_info :Path('nix-cache-info') :Args(0) {
|
||||||
my ($self, $c) = @_;
|
my ($self, $c) = @_;
|
||||||
|
$c->header('Content-Type' => 'text/plain');
|
||||||
$c->stash->{'plain'} = { data =>
|
$c->stash->{'plain'} = { data =>
|
||||||
#"StoreDir: $Nix::Config::storeDir\n" . # FIXME
|
#"StoreDir: $Nix::Config::storeDir\n" . # FIXME
|
||||||
"StoreDir: /nix/store\n" .
|
"StoreDir: /nix/store\n" .
|
||||||
|
|
Loading…
Reference in a new issue