mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 08:04:14 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
50 lines
1.3 KiB
Nix
50 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 ];
|
|
};
|
|
}
|