nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 makeWrapper,
8 pluginsDir ? null,
9}:
10
11buildGoModule rec {
12 pname = "helmfile";
13 version = "1.1.9";
14
15 src = fetchFromGitHub {
16 owner = "helmfile";
17 repo = "helmfile";
18 rev = "v${version}";
19 hash = "sha256-WatJSiNi/rUaoBGgIdRjczpMiXAwRQ21ck/ATVKyZe0=";
20 };
21
22 vendorHash = "sha256-HTs176YgrQX8s+IrOqV4BQVZfhhFkNp+T3HbmmBFdTg=";
23
24 proxyVendor = true; # darwin/linux hash mismatch
25
26 doCheck = false;
27
28 subPackages = [ "." ];
29
30 ldflags = [
31 "-s"
32 "-w"
33 "-X go.szostok.io/version.version=v${version}"
34 ];
35
36 nativeBuildInputs = [ installShellFiles ] ++ lib.optional (pluginsDir != null) makeWrapper;
37
38 postInstall =
39 lib.optionalString (pluginsDir != null) ''
40 wrapProgram $out/bin/helmfile \
41 --set HELM_PLUGINS "${pluginsDir}"
42 ''
43 + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
44 installShellCompletion --cmd helmfile \
45 --bash <($out/bin/helmfile completion bash) \
46 --fish <($out/bin/helmfile completion fish) \
47 --zsh <($out/bin/helmfile completion zsh)
48 '';
49
50 meta = {
51 description = "Declarative spec for deploying Helm charts";
52 mainProgram = "helmfile";
53 longDescription = ''
54 Declaratively deploy your Kubernetes manifests, Kustomize configs,
55 and charts as Helm releases in one shot.
56 '';
57 homepage = "https://helmfile.readthedocs.io/";
58 license = lib.licenses.mit;
59 maintainers = with lib.maintainers; [
60 pneumaticat
61 yurrriq
62 ];
63 };
64}