forked from lix-project/hydra
Add support for fetching URLs as inputs.
This commit is contained in:
parent
5a35912956
commit
bb8059e50c
|
@ -34,8 +34,13 @@ sub fetchInput {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print STDERR "copying input ", $name, " from $uri\n";
|
print STDERR "copying input ", $name, " from $uri\n";
|
||||||
|
if ( $uri =~ /^\// ) {
|
||||||
$storePath = `nix-store --add "$uri"`
|
$storePath = `nix-store --add "$uri"`
|
||||||
or die "cannot copy path $uri to the Nix store.\n";
|
or die "cannot copy path $uri to the Nix store.\n";
|
||||||
|
} else {
|
||||||
|
$storePath = `PRINT_PATH=1 nix-prefetch-url "$uri" | tail -n 1`
|
||||||
|
or die "cannot fetch $uri to the Nix store.\n";
|
||||||
|
}
|
||||||
chomp $storePath;
|
chomp $storePath;
|
||||||
|
|
||||||
$sha256 = (queryPathInfo($storePath, 0))[1] or die;
|
$sha256 = (queryPathInfo($storePath, 0))[1] or die;
|
||||||
|
|
Loading…
Reference in a new issue