From 4ae55400650b2acd7cf3f57a3d873f586531a2c2 Mon Sep 17 00:00:00 2001 From: Mirza Arnaut Date: Sun, 28 Jun 2026 02:54:15 +0200 Subject: [PATCH] herdr: add darwin support, fix meta, and improve update script - Add xcode-select wrapper for darwin builds to fix compilation - Add versionCheckHook for install checks - Fix license and update homepage - Add custom dependency argument to nix-update-script to enable auto-updates of zig dependencies --- pkgs/by-name/he/herdr/package.nix | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/he/herdr/package.nix b/pkgs/by-name/he/herdr/package.nix index 8b6971264498..a5f4887bfd03 100644 --- a/pkgs/by-name/he/herdr/package.nix +++ b/pkgs/by-name/he/herdr/package.nix @@ -1,11 +1,14 @@ { lib, + stdenv, rustPlatform, fetchFromGitHub, zig_0_15, + cctools, + xcbuild, + versionCheckHook, nix-update-script, }: - rustPlatform.buildRustPackage (finalAttrs: { pname = "herdr"; version = "0.7.0"; @@ -28,7 +31,13 @@ rustPlatform.buildRustPackage (finalAttrs: { hash = "sha256-pgGu8+NwvFcj6SrN4VaTHLeHdA7QY731ctyrHZwgFAc="; }; - nativeBuildInputs = [ zig_0_15.hook ]; + nativeBuildInputs = [ + zig_0_15.hook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + cctools + xcbuild + ]; # Upstream binary tests are renamed, added, or changed between releases and # depend on host process details, so Nix-only patches for them are brittle. @@ -44,13 +53,21 @@ rustPlatform.buildRustPackage (finalAttrs: { chmod -R u+w "$ZIG_GLOBAL_CACHE_DIR/p" ''; - passthru.updateScript = nix-update-script { }; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { + extraArgs = [ + "--custom-dep" + "zigDeps" + ]; + }; meta = { description = "Agent multiplexer that lives in your terminal"; - homepage = "https://github.com/ogulcancelik/herdr"; + homepage = "https://herdr.dev"; changelog = "https://github.com/ogulcancelik/herdr/releases/tag/v${finalAttrs.version}"; - license = lib.licenses.agpl3Only; + license = lib.licenses.agpl3Plus; maintainers = with lib.maintainers; [ kevinpita ]; mainProgram = "herdr"; platforms = lib.platforms.unix;