Remove remaining references to store_mode etc.
This commit is contained in:
@ -347,8 +347,7 @@ sub approxTableSize {
|
||||
|
||||
sub requireLocalStore {
|
||||
my ($c) = @_;
|
||||
notFound($c, "Nix channels are not supported by this Hydra server.")
|
||||
if ($c->config->{store_mode} // "direct") ne "direct";
|
||||
notFound($c, "Nix channels are not supported by this Hydra server.") if !Hydra::Helper::Nix::isLocalStore();
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,10 @@ our @EXPORT = qw(
|
||||
getEvals getMachines
|
||||
pathIsInsidePrefix
|
||||
captureStdoutStderr run grab
|
||||
getTotalShares readNixFile
|
||||
getTotalShares
|
||||
getStoreUri
|
||||
readNixFile
|
||||
isLocalStore
|
||||
cancelBuilds restartBuilds);
|
||||
|
||||
|
||||
@ -491,12 +494,22 @@ sub restartBuilds($$) {
|
||||
}
|
||||
|
||||
|
||||
sub getStoreUri {
|
||||
my $config = getHydraConfig();
|
||||
return $config->{'store_uri'} // "auto";
|
||||
}
|
||||
|
||||
|
||||
# Read a file from the (possibly remote) nix store
|
||||
sub readNixFile {
|
||||
my ($path) = @_;
|
||||
my $config = getHydraConfig();
|
||||
my $storeUri = $config->{'store_uri'} // "";
|
||||
return grab(cmd => ["nix", "cat-store", "$path"], env => { NIX_REMOTE => "$storeUri" });
|
||||
return grab(cmd => ["nix", "cat-store", "--store", getStoreUri(), "$path"]);
|
||||
}
|
||||
|
||||
|
||||
sub isLocalStore {
|
||||
my $uri = getStoreUri();
|
||||
return $uri =~ "^(local|daemon|auto)";
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user