mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
nvidia-docker: split out nvidia-container-toolkit into separate drv
This commit is contained in:
parent
610ec202dc
commit
e67c679649
@ -0,0 +1,41 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildGoModule
|
||||
, callPackage
|
||||
, makeWrapper
|
||||
, containerRuntimePath
|
||||
, configTemplate
|
||||
}:
|
||||
let
|
||||
nvidia-container-runtime = callPackage ../nvidia-container-runtime {
|
||||
inherit containerRuntimePath configTemplate;
|
||||
};
|
||||
in
|
||||
buildGoModule rec {
|
||||
pname = "nvidia-container-toolkit";
|
||||
version = "1.3.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "NVIDIA";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "04284bhgx4j55vg9ifvbji2bvmfjfy3h1lq7q356ffgw3yr9n0hn";
|
||||
};
|
||||
vendorSha256 = "17zpiyvf22skfcisflsp6pn56y6a793jcx89kw976fq2x5br1bz7";
|
||||
buildFlagsArray = [ "-ldflags=" "-s -w" ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
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";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ cpcloud ];
|
||||
};
|
||||
}
|
@ -12,23 +12,6 @@
|
||||
}:
|
||||
|
||||
with lib; let
|
||||
nvidia-container-toolkit = buildGoModule rec {
|
||||
pname = "nvidia-container-toolkit";
|
||||
version = "1.3.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "NVIDIA";
|
||||
repo = "nvidia-container-toolkit";
|
||||
rev = "v${version}";
|
||||
sha256 = "04284bhgx4j55vg9ifvbji2bvmfjfy3h1lq7q356ffgw3yr9n0hn";
|
||||
};
|
||||
vendorSha256 = "17zpiyvf22skfcisflsp6pn56y6a793jcx89kw976fq2x5br1bz7";
|
||||
buildFlagsArray = [ "-ldflags=" "-s -w" ];
|
||||
postInstall = ''
|
||||
mv $out/bin/{pkg,${pname}}
|
||||
cp $out/bin/{${pname},nvidia-container-runtime-hook}
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nvidia-docker";
|
||||
@ -46,8 +29,6 @@ stdenv.mkDerivation rec {
|
||||
|
||||
cp nvidia-docker bin
|
||||
substituteInPlace bin/nvidia-docker --subst-var-by VERSION ${version}
|
||||
|
||||
cp ${nvidia-container-toolkit}/bin/nvidia-container-{toolkit,runtime-hook} bin
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
Loading…
Reference in New Issue
Block a user