1{ lib, stdenv }:
2let
3 inherit (stdenv) hostPlatform;
4
5 # Samples are built around the CUDA Toolkit, which is not available for
6 # aarch64. Check for both CUDA version and platform.
7 platformIsSupported = hostPlatform.isx86_64 && hostPlatform.isLinux;
8
9 # Build our extension
10 extension =
11 final: _:
12 lib.attrsets.optionalAttrs platformIsSupported {
13 cuda-library-samples = final.callPackage ./generic.nix { };
14 };
15in
16extension