crush: init at 0.2.1

This commit is contained in:
x123
2025-08-03 13:39:01 +02:00
parent 97cf69ea1d
commit 7b19dbeb1c
+58
View File
@@ -0,0 +1,58 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nix-update-script,
writableTmpDirAsHomeHook,
versionCheckHook,
}:
buildGoModule (finalAttrs: {
pname = "crush";
version = "0.2.1";
src = fetchFromGitHub {
owner = "charmbracelet";
repo = "crush";
tag = "v${finalAttrs.version}";
hash = "sha256-SjrkQFSjJrPNynARE92uKA53hkstIUBSvQbqcYSsnaM=";
};
vendorHash = "sha256-aI3MSaQYUOLJxBxwCoVg13HpxK46q6ZITrw1osx5tiE=";
ldflags = [
"-s"
"-w"
"-X=github.com/charmbracelet/crush/internal/version.Version=${finalAttrs.version}"
];
# rename TestMain to prevent it from running, as it panics in the sandbox.
postPatch = ''
sed -i 's/func TestMain/func DisabledTestMain/' internal/llm/provider/openai_test.go
'';
checkFlags =
let
# these tests fail in the sandbox
skippedTests = [
"TestOpenAIClientStreamChoices"
"TestGrepWithIgnoreFiles"
"TestSearchImplementations"
];
in
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
doInstallCheck = true;
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
nativeInstallCheckInputs = [ versionCheckHook ];
updateScript = nix-update-script { };
meta = {
description = "Glamourous AI coding agent for your favourite terminal";
homepage = "https://github.com/charmbracelet/crush";
license = lib.licenses.fsl11Mit;
maintainers = with lib.maintainers; [ x123 ];
mainProgram = "crush";
};
})