2024-04-21 15:54:59 +00:00
|
|
|
{ lib, stdenv }:
|
2024-01-02 11:29:13 +00:00
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (stdenv) hostPlatform;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# Samples are built around the CUDA Toolkit, which is not available for
|
|
|
|
# aarch64. Check for both CUDA version and platform.
|
2024-01-13 08:15:51 +00:00
|
|
|
platformIsSupported = hostPlatform.isx86_64 && hostPlatform.isLinux;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
# Build our extension
|
|
|
|
extension =
|
|
|
|
final: _:
|
|
|
|
lib.attrsets.optionalAttrs platformIsSupported {
|
2024-04-21 15:54:59 +00:00
|
|
|
cuda-library-samples = final.callPackage ./generic.nix { };
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
extension
|