2021-01-06 14:10:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, callPackage
|
|
|
|
, makeWrapper
|
|
|
|
, buildGoModule
|
|
|
|
, buildGoPackage
|
|
|
|
, glibc
|
2021-01-07 23:56:56 +00:00
|
|
|
, docker
|
|
|
|
, linkFarm
|
2021-01-06 14:10:01 +00:00
|
|
|
}:
|
2019-02-27 08:44:05 +00:00
|
|
|
|
|
|
|
with lib; let
|
2021-01-06 14:10:01 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "nvidia-docker";
|
2021-01-06 14:10:01 +00:00
|
|
|
version = "2.5.0";
|
2019-02-27 08:44:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NVIDIA";
|
2021-01-09 14:35:06 +00:00
|
|
|
repo = pname;
|
2019-02-27 08:44:05 +00:00
|
|
|
rev = "v${version}";
|
2021-01-06 14:10:01 +00:00
|
|
|
sha256 = "1n1k7fnimky67s12p2ycaq9mgk245fchq62vgd7bl3bzfcbg0z4h";
|
2019-02-27 08:44:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir bin
|
2021-01-07 20:56:08 +00:00
|
|
|
|
2019-02-27 08:44:05 +00:00
|
|
|
cp nvidia-docker bin
|
2021-01-07 20:56:08 +00:00
|
|
|
substituteInPlace bin/nvidia-docker --subst-var-by VERSION ${version}
|
2019-02-27 08:44:05 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,etc}
|
|
|
|
cp -r bin $out
|
2021-01-07 23:56:56 +00:00
|
|
|
|
2019-02-27 08:44:05 +00:00
|
|
|
cp ${./config.toml} $out/etc/config.toml
|
2020-07-29 23:36:30 +01:00
|
|
|
substituteInPlace $out/etc/config.toml --subst-var-by glibcbin ${lib.getBin glibc}
|
2021-01-06 19:40:52 +00:00
|
|
|
|
|
|
|
cp ${./podman-config.toml} $out/etc/podman-config.toml
|
|
|
|
substituteInPlace $out/etc/podman-config.toml --subst-var-by glibcbin ${lib.getBin glibc}
|
2019-02-27 08:44:05 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/NVIDIA/nvidia-docker";
|
2019-02-27 08:44:05 +00:00
|
|
|
description = "NVIDIA container runtime for Docker";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2021-01-06 14:10:01 +00:00
|
|
|
maintainers = with lib.maintainers; [ cpcloud ];
|
2019-02-27 08:44:05 +00:00
|
|
|
};
|
|
|
|
}
|