1# The _cuda attribute set is a fixed-point which contains the static functionality required to construct CUDA package
2# sets. For example, `_cuda.bootstrapData` includes information about NVIDIA's redistributables (such as the names
3# NVIDIA uses for different systems), `_cuda.lib` contains utility functions like `formatCapabilities` (which generate
4# common arguments passed to NVCC and `cmakeFlags`), and `_cuda.fixups` contains `callPackage`-able functions which
5# are provided to the corresponding package's `overrideAttrs` attribute to provide package-specific fixups
6# out of scope of the generic redistributable builder.
7#
8# Since this attribute set is used to construct the CUDA package sets, it must exist outside the fixed point of the
9# package sets. Make these attributes available directly in the package set construction could cause confusion if
10# users override the attribute set with the expection that changes will be reflected in the enclosing CUDA package
11# set. To avoid this, we declare `_cuda` and inherit its members here, at top-level. (This also allows us to benefit
12# from import caching, as it should be evaluated once per system, rather than per-system and CUDA package set.)
13
14let
15 lib = import ../../../../lib;
16in
17lib.fixedPoints.makeExtensible (final: {
18 bootstrapData = import ./db/bootstrap {
19 inherit lib;
20 };
21 db = import ./db {
22 inherit (final) bootstrapData db;
23 inherit lib;
24 };
25 fixups = import ./fixups { inherit lib; };
26 lib = import ./lib {
27 _cuda = final;
28 inherit lib;
29 };
30})