2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, callPackage }:
|
2021-01-09 10:05:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "nvidia-docker";
|
2021-01-09 10:05:03 +00:00
|
|
|
version = "2.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NVIDIA";
|
2021-01-15 22:18:51 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2021-01-09 10:05:03 +00:00
|
|
|
sha256 = "1n1k7fnimky67s12p2ycaq9mgk245fchq62vgd7bl3bzfcbg0z4h";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir bin
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
cp nvidia-docker bin
|
2021-01-09 10:05:03 +00:00
|
|
|
substituteInPlace bin/nvidia-docker --subst-var-by VERSION ${version}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/nvidia-docker $out/bin
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/NVIDIA/nvidia-docker";
|
|
|
|
description = "NVIDIA container runtime for Docker";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with maintainers; [ cpcloud ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|