cudaPackages.cuda-samples: don't list package for unsupported CUDA version

+4 -4
+4 -4
pkgs/test/cuda/cuda-samples/extension.nix
··· 11 11 "11.4" = "082dkk5y34wyvjgj2p5j1d00rk8xaxb9z0mhvz16bd469r1bw2qk"; 12 12 "11.5" = "sha256-AKRZbke0K59lakhTi8dX2cR2aBuWPZkiQxyKaZTvHrI="; 13 13 "11.6" = "sha256-AsLNmAplfuQbXg9zt09tXAuFJ524EtTYsQuUlV1tPkE="; 14 - "11.7" = throw "The tag 11.7 of cuda-samples does not exist"; 14 + # The tag 11.7 of cuda-samples does not exist 15 15 "11.8" = "sha256-7+1P8+wqTKUGbCUBXGMDO9PkxYr2+PLDx9W2hXtXbuc="; 16 16 "12.0" = "sha256-Lj2kbdVFrJo5xPYPMiE4BS7Z8gpU5JLKXVJhZABUe/g="; 17 17 "12.1" = "sha256-xE0luOMq46zVsIEWwK4xjLs7NorcTIi9gbfZPVjIlqo="; 18 18 "12.2" = "sha256-pOy0qfDjA/Nr0T9PNKKefK/63gQnJV2MQsN2g3S2yng="; 19 - }.${prev.cudaVersion}; 19 + }; 20 20 21 - in { 21 + in prev.lib.attrsets.optionalAttrs (builtins.hasAttr prev.cudaVersion sha256) { 22 22 cuda-samples = final.callPackage ./generic.nix { 23 - inherit sha256; 23 + sha256 = sha256.${prev.cudaVersion}; 24 24 }; 25 25 }