_cuda.extensions: make overriding all CUDA package sets easier
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
parent
b0f64f56be
commit
36d409bc3a
@ -95,6 +95,22 @@ final: prev: {
|
||||
}
|
||||
```
|
||||
|
||||
## Extending CUDA package sets {#cuda-extending-cuda-package-sets}
|
||||
|
||||
CUDA package sets are scopes, so they provide the usual `overrideScope` attribute for overriding package attributes (see the note about `cudaMajorMinorVersion` and `_cuda` in [Configuring CUDA package sets](#cuda-configuring-cuda-package-sets)).
|
||||
|
||||
Inspired by `pythonPackagesExtensions`, the `_cuda.extensions` attribute is a list of extensions applied to every version of the CUDA package set, allowing modification of all versions of the CUDA package set without having to know what they are or find a way to enumerate and modify them explicitly. As an example, disabling `cuda_compat` across all CUDA package sets can be accomplished with this overlay:
|
||||
|
||||
```nix
|
||||
final: prev: {
|
||||
_cuda = prev._cuda.extend (
|
||||
_: prevAttrs: {
|
||||
extensions = prevAttrs.extensions ++ [ (_: _: { cuda_compat = null; }) ];
|
||||
}
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## Using cudaPackages {#cuda-using-cudapackages}
|
||||
|
||||
::: {.caution}
|
||||
|
||||
@ -35,6 +35,9 @@
|
||||
"cuda-docker-podman": [
|
||||
"index.html#cuda-docker-podman"
|
||||
],
|
||||
"cuda-extending-cuda-package-sets": [
|
||||
"index.html#cuda-extending-cuda-package-sets"
|
||||
],
|
||||
"cuda-package-set-maintenance": [
|
||||
"index.html#cuda-package-set-maintenance",
|
||||
"index.html#adding-a-new-cuda-release"
|
||||
|
||||
@ -22,6 +22,7 @@ lib.fixedPoints.makeExtensible (final: {
|
||||
inherit (final) bootstrapData db;
|
||||
inherit lib;
|
||||
};
|
||||
extensions = [ ]; # Extensions applied to every CUDA package set.
|
||||
fixups = import ./fixups { inherit lib; };
|
||||
lib = import ./lib {
|
||||
_cuda = final;
|
||||
|
||||
@ -209,6 +209,7 @@ let
|
||||
++ lib.optionals config.allowAliases [
|
||||
(import ../development/cuda-modules/aliases.nix { inherit lib; })
|
||||
]
|
||||
++ _cuda.extensions
|
||||
);
|
||||
|
||||
cudaPackages = customisation.makeScope newScope (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user