summary refs log tree commit diff
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2022-08-23 13:06:54 +0200
committerJanne Heß <janne@hess.ooo>2022-08-24 09:55:45 +0200
commit0b3e7f063cdc340ee5840a0c7ef4202d342bcd95 (patch)
treebacb15b0a3164227b49f8de90341fd39e382e6e1
parentf8594cd431042409e7c8c090eca2453be858be43 (diff)
downloadnixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar.gz
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar.bz2
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar.lz
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar.xz
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.tar.zst
nixpkgs-0b3e7f063cdc340ee5840a0c7ef4202d342bcd95.zip
boostrap fetchurl: Add SRI support
-rw-r--r--lib/minver.nix2
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2211.section.xml5
-rw-r--r--nixos/doc/manual/release-notes/rl-2211.section.md2
-rw-r--r--pkgs/build-support/fetchurl/boot.nix9
4 files changed, 15 insertions, 3 deletions
diff --git a/lib/minver.nix b/lib/minver.nix
index 86391bcd69e..507d45bba4d 100644
--- a/lib/minver.nix
+++ b/lib/minver.nix
@@ -1,2 +1,2 @@
 # Expose the minimum required version for evaluating Nixpkgs
-"2.2"
+"2.3"
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index c3c3a5d92ec..3b7f4f7ef5d 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -257,6 +257,11 @@
     <itemizedlist>
       <listitem>
         <para>
+          Nixpkgs now requires Nix 2.3 or newer.
+        </para>
+      </listitem>
+      <listitem>
+        <para>
           The <literal>isCompatible</literal> predicate checking CPU
           compatibility is no longer exposed by the platform sets
           generated using <literal>lib.systems.elaborate</literal>. In
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index 0e0ae598b34..4c4b226b97c 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -94,6 +94,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
 
 ## Backward Incompatibilities {#sec-release-22.11-incompatibilities}
 
+- Nixpkgs now requires Nix 2.3 or newer.
+
 - The `isCompatible` predicate checking CPU compatibility is no longer exposed
   by the platform sets generated using `lib.systems.elaborate`. In most cases
   you will want to use the new `canExecute` predicate instead which also
diff --git a/pkgs/build-support/fetchurl/boot.nix b/pkgs/build-support/fetchurl/boot.nix
index bd71f93c529..8f8c78b7a45 100644
--- a/pkgs/build-support/fetchurl/boot.nix
+++ b/pkgs/build-support/fetchurl/boot.nix
@@ -4,12 +4,17 @@ let mirrors = import ./mirrors.nix; in
 
 { url ? builtins.head urls
 , urls ? []
-, sha256
+, sha256 ? ""
+, hash ? ""
 , name ? baseNameOf (toString url)
 }:
 
+# assert exactly one hash is set
+assert hash != "" || sha256 != "";
+assert hash != "" -> sha256 == "";
+
 import <nix/fetchurl.nix> {
-  inherit system sha256 name;
+  inherit system hash sha256 name;
 
   url =
     # Handle mirror:// URIs. Since <nix/fetchurl.nix> currently