Initialize Nix overlay repository with blueprint, goose-cli, and docs
Add the complete overlay structure using numtide/blueprint with: - Two overlay strategies (default and shared-nixpkgs) - goose-cli package with custom librusty_v8 fetcher - Interactive package launcher via fzf - Flake input caching utility - Comprehensive README and AGENTS.md documentation
This commit is contained in:
71
packages/goose-cli/package.nix
Normal file
71
packages/goose-cli/package.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
pkg-config,
|
||||
openssl,
|
||||
libxcb,
|
||||
dbus,
|
||||
versionCheckHook,
|
||||
librusty_v8,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "goose-cli";
|
||||
version = "1.33.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "block";
|
||||
repo = "goose";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-FBICGOfVs2jbOdLWSInqfTYBdnCcbcGWHwqY/b6v8eg=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-fN0FKDYFkZrQQPWdUlemOaGzIAZhqFyskz9TEmG+X4o=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
libxcb
|
||||
dbus
|
||||
];
|
||||
|
||||
# The v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
|
||||
# To avoid this we pre-download the file and export it via RUSTY_V8_ARCHIVE
|
||||
env.RUSTY_V8_ARCHIVE = librusty_v8;
|
||||
|
||||
# Build only the CLI package
|
||||
cargoBuildFlags = [
|
||||
"--package"
|
||||
"goose-cli"
|
||||
];
|
||||
|
||||
# Enable tests with proper environment
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
export HOME=$(mktemp -d)
|
||||
export XDG_CONFIG_HOME=$HOME/.config
|
||||
export XDG_DATA_HOME=$HOME/.local/share
|
||||
export XDG_STATE_HOME=$HOME/.local/state
|
||||
export XDG_CACHE_HOME=$HOME/.cache
|
||||
mkdir -p $XDG_CONFIG_HOME $XDG_DATA_HOME $XDG_STATE_HOME $XDG_CACHE_HOME
|
||||
|
||||
# Run tests for goose-cli package only
|
||||
cargo test --package goose-cli --release
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
|
||||
passthru.category = "AI Coding Agents";
|
||||
|
||||
meta = with lib; {
|
||||
description = "CLI for Goose - a local, extensible, open source AI agent that automates engineering tasks";
|
||||
homepage = "https://github.com/block/goose";
|
||||
changelog = "https://github.com/block/goose/releases/tag/v${version}";
|
||||
license = licenses.asl20;
|
||||
sourceProvenance = with sourceTypes; [ fromSource ];
|
||||
mainProgram = "goose";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user