mochi/nixos/overlays/talosctl/default.nix
Joseph Hanson 2b6d062d16
All checks were successful
Build / nix-build (native-x86_64, telperion) (push) Successful in 2m13s
Build / nix-build (native-x86_64, gandalf) (push) Successful in 3m23s
Build / nix-build (native-x86_64, shadowfax) (push) Successful in 4m38s
reformat
2024-12-27 21:30:25 -06:00

64 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
git,
}:
buildGoModule rec {
pname = "talosctl";
version = "1.9.0";
src = fetchFromGitHub {
owner = "siderolabs";
repo = "talos";
rev = "v${version}";
hash = "sha256-j/GqAUP3514ROf64+ouvCg//9QuGoVDgxkNFqi4r+WE=";
};
vendorHash = "sha256-XvOMNyiHnemqnbOzWmzZXkr3+/ZgJDg8vjCtWFkCtLs=";
ldflags = [
"-s"
"-w"
];
subPackages = [ "cmd/talosctl" ];
doCheck = false;
# Configure offline build
GOWORK = "off";
GOPROXY = "off";
# GO111MODULE = "on";
GOSUMDB = "off";
# Use vendored dependencies
modVendorDir = "vendor";
allowGoReference = true;
preBuild = ''
export GOFLAGS="-mod=vendor"
'';
nativeBuildInputs = [
installShellFiles
git
];
postInstall = ''
installShellCompletion --cmd talosctl \
--bash <($out/bin/talosctl completion bash) \
--fish <($out/bin/talosctl completion fish) \
--zsh <($out/bin/talosctl completion zsh)
'';
meta = with lib; {
description = "A CLI for out-of-band management of Kubernetes nodes created by Talos";
homepage = "https://www.talos.dev/";
license = licenses.mpl20;
maintainers = with maintainers; [ flokli ];
mainProgram = "talosctl";
};
}