about summary refs log tree commit diff
path: root/third_party/nixpkgs/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-04-10T21·43+0200
committertazjin <mail@tazj.in>2021-04-11T11·08+0000
commit6c4ece917d65174c1c2274cc5ff176c9c0d3fd3a (patch)
tree2e5f6f266bc0ce5a4649bd77f8bd56f281dcd780 /third_party/nixpkgs/default.nix
parent726eff80f131e81e56faf4b6273ffe74e862e7ab (diff)
feat(3p/nixpkgs): Plumb through externalArgs.nixpkgsBisectPath r/2473
This lets the import of the depot root accept an additional argument
called `externalArgs`, which can be used to pass additional arguments
into a depot package set.

This is used in //third_party/nixpkgs for replacing the source of the
nixos-unstable channel with a path. With this we can bisect the
nixpkgs used in third_party easily.

Change-Id: I4f65eb3d6b521ed9f437649b7b068f1e6ab8210f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2925
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'third_party/nixpkgs/default.nix')
-rw-r--r--third_party/nixpkgs/default.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/third_party/nixpkgs/default.nix b/third_party/nixpkgs/default.nix
index 53adfe81e3..602d16b2ca 100644
--- a/third_party/nixpkgs/default.nix
+++ b/third_party/nixpkgs/default.nix
@@ -6,7 +6,7 @@
 # in //default.nix passes this attribute as the `pkgs` argument to all
 # readTree derivations.
 
-{ depot, ... }:
+{ depot, externalArgs, ... }:
 
 let
   # This provides the sources of nixpkgs. We track both
@@ -25,10 +25,16 @@ let
     sha256 = "073327ris0frqa3kpid3nsjr9w8yx2z83xpsc24w898mrs9r7d5v";
   };
 
-  nixpkgsSrc = fetchTarball {
+  # 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
+  # bisected against nixpkgs to find the root cause of an issue in a
+  # channel bump.
+  nixpkgsSrc = externalArgs.nixpkgsBisectPath or (fetchTarball {
     url = "https://github.com/NixOS/nixpkgs/archive/${unstableHashes.commit}.tar.gz";
     sha256 = unstableHashes.sha256;
-  };
+  });
+
   stableNixpkgsSrc = fetchTarball {
     url = "https://github.com/NixOS/nixpkgs/archive/${stableHashes.commit}.tar.gz";
     sha256 = stableHashes.sha256;