nixcfg/overlays/unstable/goose.nix
Harald Hoyer ef88ff4b58 chore(goose.nix): update goose-cli to version 1.0.18
Bumped the goose-cli version from 1.0.17-2 to 1.0.18 and updated corresponding hashes. Adjusted `tag` usage to dynamically inherit the version for consistency.
2025-04-16 14:56:10 +02:00

83 lines
2.7 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, rustPlatform
, dbus
, xorg
, pkg-config
, writableTmpDirAsHomeHook
, nix-update-script
, llvmPackages
,
}:
let
version = "1.0.18";
gpt-4o-tokenizer = fetchurl {
url = "https://huggingface.co/Xenova/gpt-4o/resolve/31376962e96831b948abe05d420160d0793a65a4/tokenizer.json";
hash = "sha256-Q6OtRhimqTj4wmFBVOoQwxrVOmLVaDrgsOYTNXXO8H4=";
meta.license = lib.licenses.unfree;
};
claude-tokenizer = fetchurl {
url = "https://huggingface.co/Xenova/claude-tokenizer/resolve/cae688821ea05490de49a6d3faa36468a4672fad/tokenizer.json";
hash = "sha256-wkFzffJLTn98mvT9zuKaDKkD3LKIqLdTvDRqMJKRF2c=";
meta.license = lib.licenses.unfree;
};
in
rustPlatform.buildRustPackage rec {
pname = "goose-cli";
inherit version;
src = fetchFromGitHub {
owner = "block";
repo = "goose";
tag = "v${version}";
#rev = "167ac0efdc372ddbc80273c44d8497eafe0a901e";
hash = "sha256-SCQxr1C02VdnI2rKrLvmuB2U1Ynu9IUoyISrTcmgcB8=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-vLXMBRY/7W9NMXs5qxe5cbDmehitmvrEBbMV0ZAVKrA=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ dbus ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xorg.libxcb ];
env.LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
preBuild = ''
mkdir -p tokenizer_files/Xenova--gpt-4o tokenizer_files/Xenova--claude-tokenizer
ln -s ${gpt-4o-tokenizer} tokenizer_files/Xenova--gpt-4o/tokenizer.json
ln -s ${claude-tokenizer} tokenizer_files/Xenova--claude-tokenizer/tokenizer.json
'';
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
__darwinAllowLocalNetworking = true;
checkFlags =
[
# need dbus-daemon
"--skip=config::base::tests::test_multiple_secrets"
"--skip=config::base::tests::test_secret_management"
"--skip=logging::tests::test_log_file_name::with_session_name_and_error_capture"
# Observer should be Some with both init project keys set
"--skip=tracing::langfuse_layer::tests::test_create_langfuse_observer"
"--skip=providers::gcpauth::tests::test_token_refresh_race_condition"
# Lazy instance has previously been poisoned
"--skip=jetbrains::tests::test_capabilities"
"--skip=jetbrains::tests::test_router_creation"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Open-source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM";
homepage = "https://github.com/block/goose";
mainProgram = "goose";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ cloudripper ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}