mochi/nixos/overlays/talosctl/default.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2024-12-21 17:12:17 -06:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, git }:
buildGoModule rec {
pname = "talosctl";
2024-12-21 17:12:17 -06:00
version = "1.9.0";
src = fetchFromGitHub {
owner = "siderolabs";
repo = "talos";
rev = "v${version}";
2024-12-21 17:12:17 -06:00
hash = "sha256-j/GqAUP3514ROf64+ouvCg//9QuGoVDgxkNFqi4r+WE=";
};
2024-12-21 17:12:17 -06:00
vendorHash = "sha256-XvOMNyiHnemqnbOzWmzZXkr3+/ZgJDg8vjCtWFkCtLs=";
ldflags = [ "-s" "-w" ];
subPackages = [ "cmd/talosctl" ];
2024-12-21 17:12:17 -06:00
doCheck = false;
# Configure offline build
GOWORK = "off";
GOPROXY = "off";
2024-12-27 11:19:08 -06:00
# GO111MODULE = "on";
2024-12-21 17:12:17 -06:00
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; {
2024-12-21 17:12:17 -06:00
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 ];
2024-12-21 17:12:17 -06:00
mainProgram = "talosctl";
};
}