3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/virtualization/nvidia-docker/default.nix

53 lines
1.1 KiB
Nix
Raw Normal View History

2021-01-06 14:10:01 +00:00
{ stdenv
, lib
, fetchFromGitHub
, fetchpatch
, callPackage
, makeWrapper
, buildGoModule
, buildGoPackage
, glibc
, docker
, linkFarm
2021-01-06 14:10:01 +00:00
}:
with lib; let
2021-01-06 14:10:01 +00:00
in
stdenv.mkDerivation rec {
pname = "nvidia-docker";
2021-01-06 14:10:01 +00:00
version = "2.5.0";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = pname;
rev = "v${version}";
2021-01-06 14:10:01 +00:00
sha256 = "1n1k7fnimky67s12p2ycaq9mgk245fchq62vgd7bl3bzfcbg0z4h";
};
buildPhase = ''
mkdir bin
cp nvidia-docker bin
substituteInPlace bin/nvidia-docker --subst-var-by VERSION ${version}
'';
installPhase = ''
mkdir -p $out/{bin,etc}
cp -r bin $out
cp ${./config.toml} $out/etc/config.toml
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}
'';
meta = {
homepage = "https://github.com/NVIDIA/nvidia-docker";
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 ];
};
}