about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzseri <zseri.devel@ytrizja.de>2021-12-27T22·46+0100
committerclbot <clbot@tvl.fyi>2021-12-28T09·34+0000
commitf79153998783532c9bbce9347ae7d2ac0de31d9e (patch)
tree81ac3b3a50eee782fa888de38acc5d2b09f985af
parent413c421e8bf41e0462a9015ad398b6efebaf1f1b (diff)
feat(3p/nixpkgs): allow injecting user nixpkgs config r/3487
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 <zseri.devel@ytrizja.de>
Reviewed-by: tazjin <mail@tazj.in>
Autosubmit: zseri <zseri.devel@ytrizja.de>
-rw-r--r--default.nix2
-rw-r--r--third_party/nixpkgs/default.nix10
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