nixpkgs/pkgs/by-name/he/hetzner-kube/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

55 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "hetzner-kube";
version = "0.5.1";
src = fetchFromGitHub {
owner = "xetys";
repo = "hetzner-kube";
rev = version;
hash = "sha256-XHvR+31yq0o3txMBHh2rCh2peDlG5Kh3hdl0LGm9D8c=";
};
patches = [
# Use $HOME instead of the OS user database.
# Upstream PR: https://github.com/xetys/hetzner-kube/pull/346
# Unfortunately, the PR patch does not apply against release.
./fix-home.patch
];
vendorHash = "sha256-sIjSu9U+uNc5dgt9Qg328W/28nX4F5d5zjUb7Y1xAso=";
doCheck = false;
ldflags = [
"-X github.com/xetys/hetzner-kube/cmd.version=${version}"
];
nativeBuildInputs = [
installShellFiles
];
postInstall = ''
# Need a writable home, because it fails if unable to write config.
export HOME=$TMP
$out/bin/hetzner-kube completion bash > hetzner-kube
$out/bin/hetzner-kube completion zsh > _hetzner-kube
installShellCompletion --zsh _hetzner-kube
installShellCompletion --bash hetzner-kube
'';
meta = {
description = "CLI tool for provisioning Kubernetes clusters on Hetzner Cloud";
mainProgram = "hetzner-kube";
homepage = "https://github.com/xetys/hetzner-kube";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ eliasp ];
};
}