mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
Inline fetchurl.sh
This commit is contained in:
parent
51f9f9924b
commit
2dd3117c27
3 changed files with 13 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
all-local: config.nix
|
all-local: config.nix
|
||||||
|
|
||||||
files = nar.nix buildenv.nix buildenv.pl unpack-channel.nix unpack-channel.sh derivation.nix fetchurl.nix fetchurl.sh
|
files = nar.nix buildenv.nix buildenv.pl unpack-channel.nix unpack-channel.sh derivation.nix fetchurl.nix
|
||||||
|
|
||||||
install-exec-local:
|
install-exec-local:
|
||||||
$(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs
|
$(INSTALL) -d $(DESTDIR)$(datadir)/nix/corepkgs
|
||||||
|
|
|
@ -5,13 +5,20 @@ with import <nix/config.nix>;
|
||||||
assert (outputHash != "" && outputHashAlgo != "")
|
assert (outputHash != "" && outputHashAlgo != "")
|
||||||
|| md5 != "" || sha1 != "" || sha256 != "";
|
|| md5 != "" || sha1 != "" || sha256 != "";
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
builder = builtins.toFile "fetchurl.sh"
|
||||||
|
''
|
||||||
|
echo "downloading $url into $out"
|
||||||
|
${curl} --fail --location --max-redirs 20 "$url" > "$out"
|
||||||
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
derivation {
|
derivation {
|
||||||
name = baseNameOf (toString url);
|
name = baseNameOf (toString url);
|
||||||
builder = shell;
|
builder = shell;
|
||||||
args = [ "-e" ./fetchurl.sh ];
|
args = [ "-e" builder ];
|
||||||
|
|
||||||
# Compatibility with Nix <= 0.7.
|
|
||||||
id = md5;
|
|
||||||
|
|
||||||
# New-style output content requirements.
|
# New-style output content requirements.
|
||||||
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
||||||
|
@ -19,7 +26,7 @@ derivation {
|
||||||
outputHash = if outputHash != "" then outputHash else
|
outputHash = if outputHash != "" then outputHash else
|
||||||
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
||||||
|
|
||||||
inherit system url curl;
|
inherit system url;
|
||||||
|
|
||||||
# No need to double the amount of network traffic
|
# No need to double the amount of network traffic
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
echo "downloading $url into $out"
|
|
||||||
|
|
||||||
$curl --fail --location --max-redirs 20 "$url" > "$out"
|
|
Loading…
Reference in a new issue