mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
<nix/fetchurl.nix>: Remove unnecessary assertion
This commit is contained in:
parent
40f0e3b366
commit
b63f79175e
1 changed files with 5 additions and 9 deletions
|
@ -1,24 +1,20 @@
|
||||||
{ system ? builtins.currentSystem
|
{ system ? builtins.currentSystem
|
||||||
, url
|
, url
|
||||||
, outputHash ? ""
|
|
||||||
, outputHashAlgo ? ""
|
|
||||||
, md5 ? "", sha1 ? "", sha256 ? ""
|
, md5 ? "", sha1 ? "", sha256 ? ""
|
||||||
|
, outputHash ?
|
||||||
|
if sha1 != "" then sha1 else if md5 != "" then md5 else sha256
|
||||||
|
, outputHashAlgo ?
|
||||||
|
if sha1 != "" then "sha1" else if md5 != "" then "md5" else "sha256"
|
||||||
, executable ? false
|
, executable ? false
|
||||||
, unpack ? false
|
, unpack ? false
|
||||||
, name ? baseNameOf (toString url)
|
, name ? baseNameOf (toString url)
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert (outputHash != "" && outputHashAlgo != "")
|
|
||||||
|| md5 != "" || sha1 != "" || sha256 != "";
|
|
||||||
|
|
||||||
derivation {
|
derivation {
|
||||||
builder = "builtin:fetchurl";
|
builder = "builtin:fetchurl";
|
||||||
|
|
||||||
# New-style output content requirements.
|
# New-style output content requirements.
|
||||||
outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
|
inherit outputHashAlgo outputHash;
|
||||||
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
|
||||||
outputHash = if outputHash != "" then outputHash else
|
|
||||||
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
|
||||||
outputHashMode = if unpack || executable then "recursive" else "flat";
|
outputHashMode = if unpack || executable then "recursive" else "flat";
|
||||||
|
|
||||||
inherit name system url executable unpack;
|
inherit name system url executable unpack;
|
||||||
|
|
Loading…
Reference in a new issue