From 4004d0bf91de4189ffe1d8a852ef45fefcd0e201 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Mon, 23 Feb 2026 17:51:59 +0100 Subject: [PATCH] feat: add rtk as custom Nix derivation Build rtk from source (not yet in nixpkgs) using rustPlatform.buildRustPackage. Custom derivations extracted to pkgs/ for single responsibility. Co-Authored-By: Claude Sonnet 4.6 --- packages.nix | 5 ++++- pkgs/rtk.nix | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/rtk.nix diff --git a/packages.nix b/packages.nix index d6d7d32..554ba8c 100644 --- a/packages.nix +++ b/packages.nix @@ -3,6 +3,7 @@ let atomicptr = import (fetchTarball "https://github.com/atomicptr/nix/archive/refs/heads/master.tar.gz") { }; + rtk = pkgs.callPackage ./pkgs/rtk.nix { }; in { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ @@ -127,7 +128,7 @@ in { playerctl numlockx - nixfmt-classic + nixfmt nodejs_22 fnm bun @@ -162,6 +163,8 @@ in { shfmt toilet + rtk + # AI ollama whisper-cpp # STT local diff --git a/pkgs/rtk.nix b/pkgs/rtk.nix new file mode 100644 index 0000000..7accd17 --- /dev/null +++ b/pkgs/rtk.nix @@ -0,0 +1,15 @@ +{ rustPlatform, fetchFromGitHub, pkg-config, sqlite, lib }: +rustPlatform.buildRustPackage { + pname = "rtk"; + version = "0.22.2"; + src = fetchFromGitHub { + owner = "rtk-ai"; + repo = "rtk"; + rev = "5b597002dcd99029cb9c0da9b6d38b44021bdb3a"; + hash = "sha256-a/+5w1cU/sSGsIdu/9QT1lJlURF669FxMcTiR81makE="; + }; + cargoHash = "sha256-lgmgorgT/KDSyzEcE33qkPF4f/3LJbAzEH0s9thTohE="; + doCheck = false; # tests require filesystem access (blocked by Nix sandbox) + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ sqlite ]; +}