98eb3e9ef5
GitOrigin-RevId: 00d80d13810dbfea8ab4ed1009b09100cca86ba8
29 lines
550 B
Nix
29 lines
550 B
Nix
{
|
|
lib,
|
|
writers,
|
|
runCommand,
|
|
}:
|
|
{
|
|
feature ? "cuda",
|
|
name ? feature,
|
|
libraries ? [ ],
|
|
}:
|
|
content:
|
|
|
|
let
|
|
tester = writers.writePython3Bin "tester-${name}" { inherit libraries; } content;
|
|
tester' = tester.overrideAttrs (oldAttrs: {
|
|
passthru.gpuCheck =
|
|
runCommand "test-${name}"
|
|
{
|
|
nativeBuildInputs = [ tester' ];
|
|
requiredSystemFeatures = [ feature ];
|
|
}
|
|
''
|
|
set -e
|
|
${tester.meta.mainProgram or (lib.getName tester')}
|
|
touch $out
|
|
'';
|
|
});
|
|
in
|
|
tester'
|