depot/third_party/nixpkgs/pkgs/applications/virtualization/containerd/default.nix
Default email 75ca762b89 Project import generated by Copybara.
GitOrigin-RevId: 29b0d4d0b600f8f5dd0b86e3362a33d4181938f9
2021-03-09 11:18:52 +08:00

56 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, buildGoPackage
, btrfs-progs
, go-md2man
, installShellFiles
, util-linux
, nixosTests
}:
buildGoPackage rec {
pname = "containerd";
version = "1.4.4";
src = fetchFromGitHub {
owner = "containerd";
repo = "containerd";
rev = "v${version}";
sha256 = "0qjbfj1dw6pykxhh8zahcxlgpyjzgnrngk5vjaf34akwyan8nrxb";
};
goPackagePath = "github.com/containerd/containerd";
outputs = [ "out" "man" ];
nativeBuildInputs = [ go-md2man installShellFiles util-linux ];
buildInputs = [ btrfs-progs ];
buildFlags = [ "VERSION=v${version}" "REVISION=${src.rev}" ];
BUILDTAGS = [ ]
++ lib.optional (btrfs-progs == null) "no_btrfs";
buildPhase = ''
cd go/src/${goPackagePath}
patchShebangs .
make binaries man $buildFlags
'';
installPhase = ''
install -Dm555 bin/* -t $out/bin
installManPage man/*.[1-9]
installShellCompletion --bash contrib/autocomplete/ctr
installShellCompletion --zsh --name _ctr contrib/autocomplete/zsh_autocomplete
'';
passthru.tests = { inherit (nixosTests) docker; };
meta = with lib; {
homepage = "https://containerd.io/";
description = "A daemon to control runC";
license = licenses.asl20;
maintainers = with maintainers; [ offline vdemeester ];
platforms = platforms.linux;
};
}