diff options
author | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-12-03 07:23:47 +1000 |
---|---|---|
committer | zowoq <59103226+zowoq@users.noreply.github.com> | 2020-12-29 09:33:28 +1000 |
commit | d7d6f5507c9b3b551d7b02ac8d2021b66c5e176d (patch) | |
tree | 54e6700a30290a0505190b3fb115a57e83a55993 /pkgs/applications/virtualization | |
parent | f37c665ea37d3842473d250ad097f0617344d3cd (diff) |
containerd: misc fixes
- build man during buildPhase
- use `src.rev` for `commit`
- install completion
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r-- | pkgs/applications/virtualization/containerd/default.nix | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/pkgs/applications/virtualization/containerd/default.nix b/pkgs/applications/virtualization/containerd/default.nix index cece3cc6b673..695109fd8a40 100644 --- a/pkgs/applications/virtualization/containerd/default.nix +++ b/pkgs/applications/virtualization/containerd/default.nix @@ -1,12 +1,16 @@ -{ lib, fetchFromGitHub, buildGoPackage, btrfs-progs, go-md2man, installShellFiles, util-linux, nixosTests }: - -with lib; +{ lib +, fetchFromGitHub +, buildGoPackage +, btrfs-progs +, go-md2man +, installShellFiles +, util-linux +, nixosTests +}: buildGoPackage rec { pname = "containerd"; version = "1.4.3"; - # git commit for the above version's tag - commit = "269548fa27e0089a8b8278fc4fc781d7f65a939b"; src = fetchFromGitHub { owner = "containerd"; @@ -22,29 +26,32 @@ buildGoPackage rec { buildInputs = [ btrfs-progs ]; - buildFlags = [ "VERSION=v${version}" "REVISION=${commit}" ]; + buildFlags = [ "VERSION=v${version}" "REVISION=${src.rev}" ]; - BUILDTAGS = [] - ++ optional (btrfs-progs == null) "no_btrfs"; + BUILDTAGS = [ ] + ++ lib.optional (btrfs-progs == null) "no_btrfs"; buildPhase = '' cd go/src/${goPackagePath} patchShebangs . - make binaries $buildFlags + make binaries man $buildFlags ''; installPhase = '' - for b in bin/*; do - install -Dm555 $b $out/$b - done - - make man + install -Dm555 bin/* -t $out/bin installManPage man/*.[1-9] ''; + # completion installed separately so it can be overridden in docker + # can be moved to installPhase when docker uses containerd >= 1.4 + postInstall = '' + installShellFiles --bash contrib/autocomplete/ctr + installShellFiles --zsh --name _ctr contrib/autocomplete/zsh_autocomplete + ''; + passthru.tests = { inherit (nixosTests) docker; }; - meta = { + meta = with lib; { homepage = "https://containerd.io/"; description = "A daemon to control runC"; license = licenses.asl20; |