From 14a7161fa594e4277231c7f2e0bb5dbeb8e5cd81 Mon Sep 17 00:00:00 2001 From: Ben Hipple Date: Tue, 9 Jul 2019 19:05:59 +0000 Subject: mirrors.nix: add alsa-project.org for alsa Aside from being an HTTPS endpoint, this is the canonical mirror for alsa project downloads. --- pkgs/build-support/fetchurl/mirrors.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index d9e44afb68df..f2336db8852b 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -409,9 +409,10 @@ rec { # Alsa Project alsa = [ - ftp://ftp.alsa-project.org/pub/ - http://alsa.cybermirror.org/ - http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/ - http://alsa.mirror.fr/ + https://www.alsa-project.org/files/pub/ + ftp://ftp.alsa-project.org/pub/ + http://alsa.cybermirror.org/ + http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/ + http://alsa.mirror.fr/ ]; } -- cgit 1.4.1 From 267c8d6b2fea05bc811c8e2c2f4529b1436eeb9a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 11 Jul 2019 15:48:05 +0200 Subject: fetchurl (and derived functions): Support SRI hashes E.g. fetchFromGitHub { owner = "NixOS"; repo = "nix"; rev = "ad42a784690449873fccb20192bd2150da81c56d"; hash = "sha256-ZXeadXUJMXV5lSLz6TOBeL/SSOVwQ8ywxU5AFMCnbRU="; } --- pkgs/build-support/fetchurl/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 3ce90cbeab3a..6300587a7d15 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -49,8 +49,11 @@ in # first element of `urls'). name ? "" - # Different ways of specifying the hash. -, outputHash ? "" +, # SRI hash. + hash ? "" + +, # Legacy ways of specifying the hash. + outputHash ? "" , outputHashAlgo ? "" , md5 ? "" , sha1 ? "" @@ -103,7 +106,8 @@ let else throw "fetchurl requires either `url` or `urls` to be set"; hash_ = - if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512" + if hash != "" then { outputHashAlgo = null; outputHash = hash; } + else if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512" else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; } else if sha512 != "" then { outputHashAlgo = "sha512"; outputHash = sha512; } else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; } -- cgit 1.4.1