via: `find pkgs/ -type f -exec sed -i 's/vendorSha256 = "sha256/vendorHash = "sha256/' {};`
44 lines
1 KiB
Nix
44 lines
1 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "k0sctl";
|
|
version = "0.15.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "k0sproject";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-ntjrk2OEIkAmNpf9Ag6HkSIOSA3NtO9hSJOBgvne4b0=";
|
|
};
|
|
|
|
vendorHash = "sha256-JlaXQqDO/b1xe9NA2JtuB1DZZlphWu3Mo/Mf4lhmKNo=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/k0sproject/k0sctl/version.Environment=production"
|
|
"-X github.com/carlmjohnson/versioninfo.Version=${version}"
|
|
"-X github.com/carlmjohnson/versioninfo.Revision=${version}"
|
|
];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = ''
|
|
for shell in bash zsh fish; do
|
|
installShellCompletion --cmd ${pname} \
|
|
--$shell <($out/bin/${pname} completion --shell $shell)
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A bootstrapping and management tool for k0s clusters.";
|
|
homepage = "https://k0sproject.io/";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ nickcao qjoly ];
|
|
};
|
|
}
|