git.iko.soy/typeable/nixpkgs
on master help sign in
kustomize: various

- install completion - use `src.rev` instead of git commit - use `modRoot` instead of `sourceRoot` - drop redundant `doCheck = true`

commitdeee09513341c8f68ce538348c208740631b4467 authorzowoq <59103226+zowoq@users.noreply.github.com> dateThu 7 Apr 2022, 08:37 (5 years ago) parent4e0d9f2
1 file changed+12−7
pkgs/development/tools/kustomize/default.nix+12−7
pkgs/development/tools/kustomize/default.nix+12−7
@@ -1,16 +1,14 @@
1−{ lib, buildGoModule, fetchFromGitHub }:
1+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
22
33buildGoModule rec {
44 pname = "kustomize";
55 version = "4.5.4";
6− # rev is the commit of the tag, mainly for kustomize version command output
7− rev = "cf3a452ddd6f83945d39d582243b8592ec627ae3";
86
97 ldflags = let t = "sigs.k8s.io/kustomize/api/provenance"; in
108 [
119 "-s"
1210 "-X ${t}.version=${version}"
13− "-X ${t}.gitCommit=${rev}"
11+ "-X ${t}.gitCommit=${src.rev}"
1412 ];
1513
1614 src = fetchFromGitHub {
@@ -20,13 +18,20 @@ buildGoModule rec {
2018 sha256 = "sha256-7Ode+ONgWJRNSbIpvIjhuT+oVvZgJfByFqS/iSUhcXw=";
2119 };
2220
23− doCheck = true;
24−
2521 # avoid finding test and development commands
26− sourceRoot = "source/kustomize";
22+ modRoot = "kustomize";
2723
2824 vendorSha256 = "sha256-beIbeY/+k2NgotGw5zQFkYuqMKlwctoxuToZfiFlCm4=";
2925
26+ nativeBuildInputs = [ installShellFiles ];
27+
28+ postInstall = ''
29+ installShellCompletion --cmd kustomize \
30+ --bash <($out/bin/kustomize completion bash) \
31+ --fish <($out/bin/kustomize completion fish) \
32+ --zsh <($out/bin/kustomize completion zsh)
33+ '';
34+
3035 meta = with lib; {
3136 description = "Customization of kubernetes YAML configurations";
3237 longDescription = ''