nixpkgs-instances.nix 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. { inputs, ... }:
  2. {
  3. # The _module.args definitions are passed on to modules as arguments. E.g.
  4. # the module `{ pkgs ... }: { /* config */ }` implicitly uses
  5. # `_module.args.pkgs` (defined in this case by flake-parts).
  6. perSystem =
  7. { system, ... }:
  8. {
  9. _module.args = {
  10. pkgsCuda = import inputs.nixpkgs {
  11. inherit system;
  12. # Ensure dependencies use CUDA consistently (e.g. that openmpi, ucc,
  13. # and ucx are built with CUDA support)
  14. config.cudaSupport = true;
  15. config.allowUnfreePredicate =
  16. p:
  17. builtins.all
  18. (
  19. license:
  20. license.free
  21. || builtins.elem license.shortName [
  22. "CUDA EULA"
  23. "cuDNN EULA"
  24. ]
  25. )
  26. (p.meta.licenses or [ p.meta.license ]);
  27. };
  28. # Ensure dependencies use ROCm consistently
  29. pkgsRocm = import inputs.nixpkgs {
  30. inherit system;
  31. config.rocmSupport = true;
  32. };
  33. };
  34. };
  35. }