Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
66 lines
1.7 KiB
Nix
66 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
buildGo125Module,
|
|
fetchFromGitHub,
|
|
nix-update-script,
|
|
writableTmpDirAsHomeHook,
|
|
versionCheckHook,
|
|
}:
|
|
|
|
buildGo125Module (finalAttrs: {
|
|
pname = "crush";
|
|
version = "0.9.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "charmbracelet";
|
|
repo = "crush";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-VFAGjNtXKNjkv8Ryi28oFN/uLomXXdw6NFtyjT3pMEY=";
|
|
};
|
|
|
|
vendorHash = "sha256-ktF3kIr143uPwiEbgafladZRqIsmG6jI2BeumGSu82U=";
|
|
|
|
# rename TestMain to prevent it from running, as it panics in the sandbox.
|
|
postPatch = ''
|
|
substituteInPlace internal/llm/provider/openai_test.go \
|
|
--replace-fail \
|
|
"func TestMain" \
|
|
"func DisabledTestMain"
|
|
'';
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-X=github.com/charmbracelet/crush/internal/version.Version=${finalAttrs.version}"
|
|
];
|
|
|
|
checkFlags =
|
|
let
|
|
# these tests fail in the sandbox
|
|
skippedTests = [
|
|
"TestOpenAIClientStreamChoices"
|
|
"TestGrepWithIgnoreFiles"
|
|
"TestSearchImplementations"
|
|
];
|
|
in
|
|
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
nativeCheckInputs = [ writableTmpDirAsHomeHook ];
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "--version";
|
|
doInstallCheck = true;
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Glamourous AI coding agent for your favourite terminal";
|
|
homepage = "https://github.com/charmbracelet/crush";
|
|
changelog = "https://github.com/charmbracelet/crush/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.fsl11Mit;
|
|
maintainers = with lib.maintainers; [ x123 ];
|
|
mainProgram = "crush";
|
|
};
|
|
})
|