_cuda.extensions: make overriding all CUDA package sets easier

Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>

Changed files
+21
doc
languages-frameworks
pkgs
development
cuda-modules
_cuda
top-level
+16
doc/languages-frameworks/cuda.section.md
···
}
```
## Using cudaPackages {#cuda-using-cudapackages}
::: {.caution}
···
}
```
+
## 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}
+3
doc/redirects.json
···
"cuda-docker-podman": [
"index.html#cuda-docker-podman"
],
"cuda-package-set-maintenance": [
"index.html#cuda-package-set-maintenance",
"index.html#adding-a-new-cuda-release"
···
"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"
+1
pkgs/development/cuda-modules/_cuda/default.nix
···
inherit (final) bootstrapData db;
inherit lib;
};
fixups = import ./fixups { inherit lib; };
lib = import ./lib {
_cuda = 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;
+1
pkgs/top-level/cuda-packages.nix
···
++ lib.optionals config.allowAliases [
(import ../development/cuda-modules/aliases.nix { inherit lib; })
]
);
cudaPackages = customisation.makeScope newScope (
···
++ lib.optionals config.allowAliases [
(import ../development/cuda-modules/aliases.nix { inherit lib; })
]
+
++ _cuda.extensions
);
cudaPackages = customisation.makeScope newScope (