2021-01-09 15:40:45 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoModule
|
|
|
|
, makeWrapper
|
2021-01-10 14:09:36 +01:00
|
|
|
, nvidia-container-runtime
|
2021-01-09 15:40:45 +01:00
|
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "nvidia-container-toolkit";
|
2021-09-07 06:27:31 +02:00
|
|
|
version = "1.5.0";
|
2021-01-10 13:58:41 +01:00
|
|
|
|
2021-01-09 15:40:45 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NVIDIA";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-07 06:27:31 +02:00
|
|
|
sha256 = "sha256-YvwqnwYOrlSE6PmNNZ5xjEaEcXdHKcakIwua+tOvIJ0=";
|
2021-01-09 15:40:45 +01:00
|
|
|
};
|
2021-01-10 13:58:41 +01:00
|
|
|
|
2021-01-09 15:40:45 +01:00
|
|
|
vendorSha256 = "17zpiyvf22skfcisflsp6pn56y6a793jcx89kw976fq2x5br1bz7";
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [ "-s" "-w" ];
|
2021-01-09 15:40:45 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-01-10 13:58:41 +01:00
|
|
|
|
2021-01-09 15:40:45 +01:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/{pkg,${pname}}
|
|
|
|
ln -s $out/bin/nvidia-container-{toolkit,runtime-hook}
|
|
|
|
|
|
|
|
wrapProgram $out/bin/nvidia-container-toolkit \
|
|
|
|
--add-flags "-config ${nvidia-container-runtime}/etc/nvidia-container-runtime/config.toml"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/NVIDIA/nvidia-container-toolkit";
|
|
|
|
description = "NVIDIA container runtime hook";
|
2021-01-10 14:53:07 +01:00
|
|
|
license = licenses.asl20;
|
2021-01-09 15:40:45 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
|
|
|
};
|
|
|
|
}
|