diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 45a145a7..d8e80d0a 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -30,6 +30,8 @@ sub index :Path :Args(0) { $c->stash->{template} = 'overview.tt'; $c->stash->{projects} = [$c->model('DB::Projects')->search(isAdmin($c) ? {} : {hidden => 0}, {order_by => 'name'})]; $c->stash->{newsItems} = [$c->model('DB::NewsItems')->search({}, { order_by => ['createtime DESC'], rows => 5 })]; +# $c->stash->{nrbuilds} = [nrbuildsQuery($c, 30, "day", "", "", "", "")]; + # } @@ -186,7 +188,7 @@ sub end : ActionClass('RenderView') { sub nar :Local :Args(1) { my ($self, $c, $path) = @_; - $path = "/nix/store/$path"; + $path = ($ENV{NIX_STORE_DIR}."/$path" || "/nix/store/$path" ); if (!isValidPath($path)) { $c->response->status(410); # "Gone" diff --git a/src/lib/Hydra/Helper/AddBuilds.pm b/src/lib/Hydra/Helper/AddBuilds.pm index 5bbc9a95..753ebc54 100644 --- a/src/lib/Hydra/Helper/AddBuilds.pm +++ b/src/lib/Hydra/Helper/AddBuilds.pm @@ -21,7 +21,7 @@ sub scmPath { sub getBuildLog { my ($drvPath) = @_; - my $logPath = "/nix/var/log/nix/drvs/" . basename $drvPath; + my $logPath = ($ENV{NIX_LOG_DIR} || "/nix/var/log/nix"). "/drvs/" . basename $drvPath; return -e $logPath ? $logPath : undef; } diff --git a/src/lib/Hydra/Helper/Nix.pm b/src/lib/Hydra/Helper/Nix.pm index d514a7d2..d4ddd376 100644 --- a/src/lib/Hydra/Helper/Nix.pm +++ b/src/lib/Hydra/Helper/Nix.pm @@ -30,8 +30,8 @@ sub getHydraPath { } sub getHydraConf { - my $conf = $ENV{"HYDRA_CONF"} || (getHydraPath . "/hydra.conf"); - die "The HYDRA_CONF file ($conf) does not exist!\n" unless -f $conf; + my $conf = $ENV{"HYDRA_CONFIG"} || (getHydraPath . "/hydra.conf"); + die "The HYDRA_CONFIG file ($conf) does not exist!\n" unless -f $conf; return $conf; } @@ -74,7 +74,7 @@ sub txn_do { sub getGCRootsDir { die unless defined $ENV{LOGNAME}; - my $dir = "/nix/var/nix/gcroots/per-user/$ENV{LOGNAME}/hydra-roots"; + my $dir = ($ENV{NIX_STATE_DIR} || "/nix/var/nix" ) . "/gcroots/per-user/$ENV{LOGNAME}/hydra-roots"; mkpath $dir if !-e $dir; return $dir; }