|
| 1 | +diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix |
| 2 | +index 3bc88f59c4bb..37d480116299 100644 |
| 3 | +--- a/pkgs/stdenv/default.nix |
| 4 | ++++ b/pkgs/stdenv/default.nix |
| 5 | +@@ -43,7 +43,7 @@ in |
| 6 | + # Select the appropriate stages for the platform `system'. |
| 7 | + if crossSystem != localSystem || crossOverlays != [ ] then |
| 8 | + stagesCross |
| 9 | +-else if config ? replaceStdenv then |
| 10 | ++else if config.replaceStdenv or null != null then |
| 11 | + stagesCustom |
| 12 | + else if localSystem.isLinux then |
| 13 | + stagesLinux |
| 14 | +diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix |
| 15 | +index c8e8a3f58590..cc3aa6fc0242 100644 |
| 16 | +--- a/pkgs/top-level/config.nix |
| 17 | ++++ b/pkgs/top-level/config.nix |
| 18 | +@@ -266,6 +266,32 @@ let |
| 19 | + feature = "build packages with CUDA support by default"; |
| 20 | + }; |
| 21 | + |
| 22 | ++ cudaCapabilities = mkMassRebuild { |
| 23 | ++ type = types.listOf types.str; |
| 24 | ++ default = [ ]; |
| 25 | ++ description = '' |
| 26 | ++ List of CUDA capabilities to build for (e.g., `["8.9"]` for RTX 4090). |
| 27 | ++ If empty, uses the default capabilities for the CUDA version. |
| 28 | ++ See https://developer.nvidia.com/cuda-gpus for capability values. |
| 29 | ++ ''; |
| 30 | ++ }; |
| 31 | ++ |
| 32 | ++ cudaForwardCompat = mkMassRebuild { |
| 33 | ++ default = true; |
| 34 | ++ feature = "build CUDA packages with forward compatibility (PTX)"; |
| 35 | ++ }; |
| 36 | ++ |
| 37 | ++ replaceStdenv = mkOption { |
| 38 | ++ type = types.nullOr (types.functionTo types.raw); |
| 39 | ++ default = null; |
| 40 | ++ description = '' |
| 41 | ++ A function to replace the default stdenv. |
| 42 | ++ Takes `{ pkgs }` as argument and returns a custom stdenv. |
| 43 | ++ When set, nixpkgs will use this stdenv instead of the default. |
| 44 | ++ ''; |
| 45 | ++ example = literalExpression "{ pkgs }: pkgs.ccacheStdenv"; |
| 46 | ++ }; |
| 47 | ++ |
| 48 | + replaceBootstrapFiles = mkMassRebuild { |
| 49 | + type = types.functionTo (types.attrsOf types.package); |
| 50 | + default = lib.id; |
0 commit comments