From 9c78e5a4903f08c9d98289f303e9ba99d9e154c0 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 4 Jun 2022 01:38:25 +0200 Subject: fix(3p/nixpkgs): pass the same args to stable as to unstable nixpkgs 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 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nixpkgs/default.nix | 30 +++++++++++++++++------------- 1 file 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 [ ]); -} +}) -- cgit 1.4.1