nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9buildGoModule rec {
10 pname = "kustomize_4";
11 version = "4.5.7";
12
13 src = fetchFromGitHub {
14 owner = "kubernetes-sigs";
15 repo = "kustomize";
16 rev = "kustomize/v${version}";
17 hash = "sha256-AHDUwXcYkI04nOBY8jScf+OE6k9Z5OqzhtWExK1rrKg=";
18 };
19
20 # rev is the commit of the tag, mainly for kustomize version command output
21 rev = "56d82a8378dfc8dc3b3b1085e5a6e67b82966bd7";
22 ldflags =
23 let
24 t = "sigs.k8s.io/kustomize/api/provenance";
25 in
26 [
27 "-s"
28 "-X ${t}.version=${version}"
29 "-X ${t}.gitCommit=${rev}"
30 ];
31
32 # avoid finding test and development commands
33 modRoot = "kustomize";
34 proxyVendor = true;
35 vendorHash = "sha256-9+k0Me5alZDNC27Mx0Q6vp0B2SEa+Qy0FoLSr/Rahkc=";
36
37 nativeBuildInputs = [ installShellFiles ];
38
39 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
40 installShellCompletion --cmd kustomize \
41 --bash <($out/bin/kustomize completion bash) \
42 --fish <($out/bin/kustomize completion fish) \
43 --zsh <($out/bin/kustomize completion zsh)
44 '';
45
46 meta = {
47 description = "Customization of kubernetes YAML configurations";
48 mainProgram = "kustomize";
49 longDescription = ''
50 kustomize lets you customize raw, template-free YAML files for
51 multiple purposes, leaving the original YAML untouched and usable
52 as is.
53 '';
54 homepage = "https://github.com/kubernetes-sigs/kustomize";
55 license = lib.licenses.asl20;
56 maintainers = with lib.maintainers; [
57 carlosdagos
58 vdemeester
59 zaninime
60 Chili-Man
61 saschagrunert
62 ];
63 };
64}