nixpkgs/pkgs/applications/networking/cluster/tanka/default.nix
Samuel Noordhuis 75572091cd
tanka: 0.14.0 -> 0.15.0
Update Tanka to the latest release.

Change `meta.homepage` to point to the Tanka website instead of the
GitHub repository.

Add the `subPackage` attribute and additional ldflags arguments to
`buildFlagsArray`. Both are needed to fix the issue where `tk --version`
would print `dev` instead of the version string. The ldflags arguments
were copied from the Makefile in the Tanka repository.
2021-03-24 12:34:17 +11:00

37 lines
960 B
Nix

{ buildGoModule, fetchFromGitHub, lib, installShellFiles }:
buildGoModule rec {
pname = "tanka";
version = "0.15.0";
src = fetchFromGitHub {
owner = "grafana";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ckXvDB3TU9HAXowAAr/fRmX3mylVvPKW8I74R/vUaRY=";
};
vendorSha256 = "sha256-vpm2y/CxRNWkz6+AOMmmZH5AjRQWAa6WD5Fnx5lqJYw=";
doCheck = false;
subPackages = [ "cmd/tk" ];
buildFlagsArray = [ "-ldflags=-s -w -extldflags \"-static\" -X github.com/grafana/tanka/pkg/tanka.CURRENT_VERSION=v${version}" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
echo "complete -C $out/bin/tk tk" > tk.bash
installShellCompletion tk.bash
'';
meta = with lib; {
description = "Flexible, reusable and concise configuration for Kubernetes";
homepage = "https://tanka.dev";
license = licenses.asl20;
maintainers = with maintainers; [ mikefaille ];
platforms = platforms.unix;
};
}