From fad2a084faeaae6bf8e39c33ccdc3eba5dd24f2c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Jul 2012 20:26:34 +0000 Subject: [PATCH] Provide the nix-cache-info file required by the binary cache substituter --- src/lib/Hydra/Controller/Root.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 2e970625..cfe02008 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -7,6 +7,7 @@ use Hydra::Helper::Nix; use Hydra::Helper::CatalystUtils; use Digest::SHA1 qw(sha1_hex); use Nix::Store; +use Nix::Config; # Put this controller at top-level. __PACKAGE__->config->{namespace} = ''; @@ -195,6 +196,17 @@ sub nar :Local :Args(1) { } +sub nix_cache_info :Path('nix-cache-info') :Args(0) { + my ($self, $c) = @_; + $c->stash->{'plain'} = { data => + #"StoreDir: $Nix::Config::storeDir\n" . # FIXME + "StoreDir: /nix/store\n" . + "WantMassQuery: 0\n" + }; + $c->forward('Hydra::View::Plain'); +} + + sub hashToPath { my ($c, $hash) = @_; die if length($hash) != 32; @@ -212,7 +224,7 @@ sub narinfo :LocalRegex('^([a-z0-9]+).narinfo$') :Args(0) { } -sub change_password : Path('change-password') : Args(0) { +sub change_password : Path('change-password') :Args(0) { my ($self, $c) = @_; requireLogin($c) if !$c->user_exists;