summary refs log tree commit diff
path: root/pkgs/development/tools/kustomize
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2022-04-07 08:37:24 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2022-04-07 11:30:59 +1000
commitdeee09513341c8f68ce538348c208740631b4467 (patch)
tree38fd68ef8b0a6ed6db2100fbb0eb7226cb3981c2 /pkgs/development/tools/kustomize
parent4e0d9f2b6016e2ae6295a35785a379f8023d3759 (diff)
downloadnixpkgs-deee09513341c8f68ce538348c208740631b4467.tar
nixpkgs-deee09513341c8f68ce538348c208740631b4467.tar.gz
nixpkgs-deee09513341c8f68ce538348c208740631b4467.tar.bz2
nixpkgs-deee09513341c8f68ce538348c208740631b4467.tar.lz
nixpkgs-deee09513341c8f68ce538348c208740631b4467.tar.xz
nixpkgs-deee09513341c8f68ce538348c208740631b4467.tar.zst
nixpkgs-deee09513341c8f68ce538348c208740631b4467.zip
kustomize: various
- install completion
- use `src.rev` instead of git commit
- use `modRoot` instead of `sourceRoot`
- drop redundant `doCheck = true`
Diffstat (limited to 'pkgs/development/tools/kustomize')
-rw-r--r--pkgs/development/tools/kustomize/default.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/pkgs/development/tools/kustomize/default.nix b/pkgs/development/tools/kustomize/default.nix
index 92cab080aa8..49bf3f35ad8 100644
--- a/pkgs/development/tools/kustomize/default.nix
+++ b/pkgs/development/tools/kustomize/default.nix
@@ -1,16 +1,14 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "kustomize";
   version = "4.5.4";
-  # rev is the commit of the tag, mainly for kustomize version command output
-  rev = "cf3a452ddd6f83945d39d582243b8592ec627ae3";
 
   ldflags = let t = "sigs.k8s.io/kustomize/api/provenance"; in
     [
       "-s"
       "-X ${t}.version=${version}"
-      "-X ${t}.gitCommit=${rev}"
+      "-X ${t}.gitCommit=${src.rev}"
     ];
 
   src = fetchFromGitHub {
@@ -20,13 +18,20 @@ buildGoModule rec {
     sha256 = "sha256-7Ode+ONgWJRNSbIpvIjhuT+oVvZgJfByFqS/iSUhcXw=";
   };
 
-  doCheck = true;
-
   # avoid finding test and development commands
-  sourceRoot = "source/kustomize";
+  modRoot = "kustomize";
 
   vendorSha256 = "sha256-beIbeY/+k2NgotGw5zQFkYuqMKlwctoxuToZfiFlCm4=";
 
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    installShellCompletion --cmd kustomize \
+      --bash <($out/bin/kustomize completion bash) \
+      --fish <($out/bin/kustomize completion fish) \
+      --zsh <($out/bin/kustomize completion zsh)
+  '';
+
   meta = with lib; {
     description = "Customization of kubernetes YAML configurations";
     longDescription = ''