Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/stdenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ in
# Select the appropriate stages for the platform `system'.
if crossSystem != localSystem || crossOverlays != [ ] then
stagesCross
else if config ? replaceStdenv then
else if (config.replaceStdenv or null) != null then
Comment thread
byteforge38 marked this conversation as resolved.
stagesCustom
else if localSystem.isLinux then
stagesLinux
Expand Down
48 changes: 48 additions & 0 deletions pkgs/top-level/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,38 @@ let
feature = "build packages with CUDA support by default";
};

cudaCapabilities = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
A list of CUDA capabilities to build for.

Packages may use this option to control device code generation to
take advantage of architecture-specific functionality, speed up
compile times by producing less device code, or slim package closures.

For example, you can build for Ada Lovelace GPUs with
`cudaCapabilities = [ "8.9" ];`.

If not provided, the default value is calculated per-package set,
derived from a list of GPUs supported by that CUDA version.

See the [CUDA section](https://nixos.org/manual/nixpkgs/stable/#cuda) in
the Nixpkgs manual for more information.
'';
};

cudaForwardCompat = mkOption {
type = types.bool;
default = true;
description = ''
Whether to enable PTX support for future hardware.

When enabled, packages will include PTX code that can be JIT-compiled
for GPUs newer than those explicitly targeted by `cudaCapabilities`.
'';
};

replaceBootstrapFiles = mkMassRebuild {
type = types.functionTo (types.attrsOf types.package);
default = lib.id;
Expand Down Expand Up @@ -294,6 +326,22 @@ let
'';
};

replaceStdenv = mkMassRebuild {
type = types.nullOr (types.functionTo types.package);
default = null;
defaultText = literalExpression "null";
description = ''
A function to replace the standard environment (stdenv).

The function receives an attribute set with `pkgs` and should return
a stdenv derivation.

This can be used to globally replace the stdenv with a custom one,
for example to use ccache or distcc.
'';
example = literalExpression "{ pkgs }: pkgs.ccacheStdenv";
};

rocmSupport = mkMassRebuild {
feature = "build packages with ROCm support by default";
};
Expand Down
Loading