From f79153998783532c9bbce9347ae7d2ac0de31d9e Mon Sep 17 00:00:00 2001 From: zseri Date: Mon, 27 Dec 2021 23:46:27 +0100 Subject: feat(3p/nixpkgs): allow injecting user nixpkgs config use case: system-wide 'testing' usage of content-addressed derivations Change-Id: I1f63ddf679da7d53ff0d8a851642dd081a70fe55 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4551 Tested-by: BuildkiteCI Reviewed-by: zseri Reviewed-by: tazjin Autosubmit: zseri --- default.nix | 2 +- third_party/nixpkgs/default.nix | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 9a73e99d8960..fd02dfbde927 100644 --- a/default.nix +++ b/default.nix @@ -2,7 +2,7 @@ # (see //nix/readTree for details) and constructing a matching attribute set # tree. -{ nixpkgsBisectPath ? null, ... }@args: +{ nixpkgsBisectPath ? null, nixpkgsConfig ? {}, ... }@args: let inherit (builtins) diff --git a/third_party/nixpkgs/default.nix b/third_party/nixpkgs/default.nix index 872a7e79e88a..f8831f1fd591 100644 --- a/third_party/nixpkgs/default.nix +++ b/third_party/nixpkgs/default.nix @@ -57,9 +57,15 @@ let stable = stableHashes.commit; }; }; + in import nixpkgsSrc { - config.allowUnfree = true; - config.allowBroken = true; + # 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; + }; overlays = [ commitsOverlay stableOverlay -- cgit 1.4.1