_cuda.lib.selectManifests: init

Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
This commit is contained in:
Connor Baker
2025-10-23 14:04:06 -07:00
parent 2811ae30af
commit bd217ed50d
2 changed files with 31 additions and 0 deletions
@@ -33,6 +33,7 @@
getNixSystems
getRedistSystem
mkRedistUrl
selectManifests
;
# See ./strings.nix for documentation.
@@ -237,4 +237,34 @@
)
++ [ relativePath ]
);
/**
Function which accepts an attribute set mapping redistributable name to version and retrieves the corresponding
collection of manifests from `_cuda.manifests`. Additionally, the version provided is used to populate the
`release_label` field in the corresponding manifest if it is missing.
It is an error to provide a redistributable name and version for which there is no corresponding manifest.
# Type
```
selectManifests :: (versions :: AttrSet RedistName Version) -> AttrSet RedistName Manifest
```
# Inputs
`versions`
: An attribute set mapping redistributable name to manifest version
*/
selectManifests = lib.mapAttrs (
name: version:
let
manifest = _cuda.manifests.${name}.${version};
in
manifest
// {
release_label = manifest.release_label or version;
}
);
}