about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-06-03T23·38+0200
committerclbot <clbot@tvl.fyi>2022-06-03T23·50+0000
commit9c78e5a4903f08c9d98289f303e9ba99d9e154c0 (patch)
treeed36fa310907c127ae0cf66419b829eb01518a21
parent7fea2bdc456f9d5a0b827f23706fc414d986adcb (diff)
fix(3p/nixpkgs): pass the same args to stable as to unstable nixpkgs r/4210
Of course we can't pass the overlays without causing an infinite
recursion, but they are also intended purely for unstable nixpkgs,
so it doesn't matter.

Change-Id: I0e1b42e37ad12872f9420cf59dff6d944b2bc5d3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5847
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
-rw-r--r--third_party/nixpkgs/default.nix30
1 files changed, 17 insertions, 13 deletions
diff --git a/third_party/nixpkgs/default.nix b/third_party/nixpkgs/default.nix
index 4007d00f9d..73b3b8b953 100644
--- a/third_party/nixpkgs/default.nix
+++ b/third_party/nixpkgs/default.nix
@@ -16,6 +16,20 @@
 }:
 
 let
+  # Arguments passed to both the stable nixpkgs and the main, unstable one.
+  # Includes everything but overlays which are only passed to unstable nixpkgs.
+  commonNixpkgsArgs = {
+    # allow users to inject their config into builds (e.g. to test CA derivations)
+    config =
+      (if externalArgs ? nixpkgsConfig then externalArgs.nixpkgsConfig else { })
+      // {
+        allowUnfree = true;
+        allowBroken = true;
+      };
+
+    inherit localSystem;
+  };
+
   # import the nixos-unstable package set, or optionally use the
   # source (e.g. a path) specified by the `nixpkgsBisectPath`
   # argument. This is intended for use-cases where the depot is
@@ -25,7 +39,7 @@ let
 
   # Stable package set is imported, but not exposed, to overlay
   # required packages into the unstable set.
-  stableNixpkgs = import depot.third_party.sources.nixpkgs-stable { };
+  stableNixpkgs = import depot.third_party.sources.nixpkgs-stable commonNixpkgsArgs;
 
   # Overlay for packages that should come from the stable channel
   # instead (e.g. because something is broken in unstable).
@@ -44,17 +58,7 @@ let
     };
   };
 in
-import nixpkgsSrc {
-  # allow users to inject their config into builds (e.g. to test CA derivations)
-  config =
-    (if externalArgs ? nixpkgsConfig then externalArgs.nixpkgsConfig else { })
-    // {
-      allowUnfree = true;
-      allowBroken = true;
-    };
-
-  inherit localSystem;
-
+import nixpkgsSrc (commonNixpkgsArgs // {
   overlays = [
     commitsOverlay
     stableOverlay
@@ -65,4 +69,4 @@ import nixpkgsSrc {
     depot.third_party.overlays.ecl-static
     depot.third_party.overlays.dhall
   ] else [ ]);
-}
+})