diff --git a/nixos/home/jahanson/workstation.nix b/nixos/home/jahanson/workstation.nix index ca7b669..75df8ed 100644 --- a/nixos/home/jahanson/workstation.nix +++ b/nixos/home/jahanson/workstation.nix @@ -46,7 +46,6 @@ with config; obsidian parsec-bin solaar # open source manager for logitech unifying receivers - talosctl # overlay override unstable.bruno unstable.fractal unstable.httpie @@ -54,6 +53,7 @@ with config; unstable.jetbrains.rust-rover unstable.peazip unstable.seabird + unstable.talosctl # overlay override unstable.telegram-desktop unstable.tidal-hifi # unstable.vesktop # gpu issues. Using the flatpak version solves this issue. diff --git a/nixos/overlays/default.nix b/nixos/overlays/default.nix index 786aa47..facee9e 100644 --- a/nixos/overlays/default.nix +++ b/nixos/overlays/default.nix @@ -1,11 +1,9 @@ { inputs, ... }: let - inherit (inputs.nixpkgs) lib; # smartmontoolsOverlay = import ./smartmontools { }; # vivaldiOverlay = self: super: { vivaldi = super.callPackage ./vivaldi { }; }; coderOverlay = self: super: { coder = super.callPackage ./coder { }; }; modsOverlay = self: super: { mods = super.callPackage ./charm-mods { }; }; - talosctlOverlay = import ./talosctl { }; termiusOverlay = self: super: { termius = super.callPackage ./termius { }; }; in { @@ -16,15 +14,20 @@ in mods = modsOverlay; nix-minecraft = inputs.nix-minecraft.overlay; nur = inputs.nur.overlay; - talosctl = talosctlOverlay; termius = termiusOverlay; # The unstable nixpkgs set (declared in the flake inputs) will # be accessible through 'pkgs.unstable' - unstable-packages = final: _prev: { - unstable = import inputs.nixpkgs-unstable { - inherit (final) system; - config.allowUnfree = true; + unstable-packages = final: prev: { + unstable = import inputs.nixpkgs-unstable + { + inherit (final) system; + config.allowUnfree = true; + } // { + # Add talosctl to the unstable set + talosctl = final.unstable.callPackage ./talosctl/talosctl-full.nix { + inherit (final.unstable) lib buildGoModule fetchFromGitHub installShellFiles; + }; }; }; } diff --git a/nixos/overlays/talosctl/talosctl-full.nix b/nixos/overlays/talosctl/talosctl-full.nix new file mode 100644 index 0000000..801a4cf --- /dev/null +++ b/nixos/overlays/talosctl/talosctl-full.nix @@ -0,0 +1,40 @@ +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: + +buildGoModule rec { + pname = "talosctl"; + version = "1.8.1"; + + src = fetchFromGitHub { + owner = "siderolabs"; + repo = "talos"; + rev = "v${version}"; + hash = "sha256-6WHeiVH/vZHiM4bqq3T5lC0ARldJyZtIErPeDgrZgxc="; + }; + + vendorHash = "sha256-aTtvVpL979BUvSBwBqRqCWSWIBBmmty9vBD97Q5P4+E="; + + ldflags = [ "-s" "-w" ]; + + env.GOWORK = "off"; + + subPackages = [ "cmd/talosctl" ]; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installShellCompletion --cmd talosctl \ + --bash <($out/bin/talosctl completion bash) \ + --fish <($out/bin/talosctl completion fish) \ + --zsh <($out/bin/talosctl completion zsh) + ''; + + doCheck = false; # no tests + + meta = with lib; { + description = "CLI for out-of-band management of Kubernetes nodes created by Talos"; + mainProgram = "talosctl"; + homepage = "https://www.talos.dev/"; + license = licenses.mpl20; + maintainers = with maintainers; [ flokli ]; + }; +}