nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 versionCheckHook,
8}:
9
10buildGoModule rec {
11 pname = "talosctl";
12 version = "1.12.2";
13
14 src = fetchFromGitHub {
15 owner = "siderolabs";
16 repo = "talos";
17 tag = "v${version}";
18 hash = "sha256-E3WeFu4PpgJN+ZLeTfAqqkTgInu/imytpdCixM33wiw=";
19 };
20
21 vendorHash = "sha256-1RNNAGCvmtau7oI4gSUpz+savxSugp2yh2THwt/mNG4=";
22
23 ldflags = [
24 "-s"
25 "-w"
26 ];
27
28 env.GOWORK = "off";
29
30 subPackages = [ "cmd/talosctl" ];
31
32 nativeBuildInputs = [ installShellFiles ];
33
34 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
35 installShellCompletion --cmd talosctl \
36 --bash <($out/bin/talosctl completion bash) \
37 --fish <($out/bin/talosctl completion fish) \
38 --zsh <($out/bin/talosctl completion zsh)
39 '';
40
41 doCheck = false; # no tests
42
43 doInstallCheck = true;
44 nativeInstallCheckInputs = [ versionCheckHook ];
45 versionCheckProgramArg = "version";
46
47 meta = {
48 description = "CLI for out-of-band management of Kubernetes nodes created by Talos";
49 mainProgram = "talosctl";
50 homepage = "https://www.talos.dev/";
51 license = lib.licenses.mpl20;
52 maintainers = with lib.maintainers; [ flokli ];
53 };
54}