diff options
-rw-r--r-- | default.nix | 9 | ||||
-rw-r--r-- | third_party/nixpkgs/default.nix | 12 |
2 files changed, 17 insertions, 4 deletions
diff --git a/default.nix b/default.nix index ee2207757494..cc2ebcabcfba 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,7 @@ # This makes packages accessible via the Nixery instance that is configured to # use this repository as its nixpkgs source. -{ ... }@args: +{ nixpkgsBisectPath ? null, ... }@args: with builtins; @@ -24,6 +24,13 @@ let # Pass third_party as 'pkgs' (for compatibility with external # imports for certain subdirectories) pkgs = depot.third_party.nixpkgs; + + # Pass arguments passed to the entire depot through, for packages + # that would like to add functionality based on this. + # + # Note that it is intended for exceptional circumstance, such as + # debugging by bisecting nixpkgs. + externalArgs = args; }; readTree' = import ./nix/readTree {}; diff --git a/third_party/nixpkgs/default.nix b/third_party/nixpkgs/default.nix index 53adfe81e388..602d16b2cab7 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; |