kulala-core: init at 0.6.0; vimPlugins.kulala-nvim: 5.3.4 -> 6.1.0 (#523733)

This commit is contained in:
Gaétan Lepage
2026-05-24 20:15:31 +00:00
committed by GitHub
3 changed files with 130 additions and 5 deletions
@@ -8348,12 +8348,12 @@ final: prev: {
kulala-nvim = buildVimPlugin {
pname = "kulala.nvim";
version = "5.3.4";
version = "6.1.0";
src = fetchFromGitHub {
owner = "mistweaverco";
repo = "kulala.nvim";
tag = "v5.3.4";
hash = "sha256-yA7ooPASC59FuwzB2xZyG6LsXpHHQ+fqtE/4odEjGx4=";
tag = "v6.1.0";
hash = "sha256-0wr4MdsKnS6qcmmhhRgPlSEhlyY64zQ+fArbjvdusOE=";
fetchSubmodules = true;
};
meta.homepage = "https://github.com/mistweaverco/kulala.nvim/";
@@ -28,6 +28,7 @@
htop,
jq,
khard,
kulala-core,
languagetool,
libgit2,
llvmPackages,
@@ -1950,16 +1951,17 @@ assertNoAdditions {
in
{
dependencies = [ kulala-http-grammar ];
buildInputs = [ curl ];
postPatch = ''
substituteInPlace lua/kulala/config/defaults.lua \
--replace-fail 'curl_path = "curl"' 'curl_path = "${lib.getExe curl}"'
--replace-fail 'path = nil' 'path = "${lib.getExe kulala-core}"'
'';
nvimSkipModules = [
# Requires some extra work to get CLI working in nixpkgs
"cli.kulala_cli"
# Legacy parser module; active parsing is handled by kulala-core
"kulala.parser.treesitter"
];
}
);
+123
View File
@@ -0,0 +1,123 @@
{
lib,
stdenv,
bun,
curl,
fetchFromGitHub,
makeWrapper,
writableTmpDirAsHomeHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "kulala-core";
version = "0.6.0";
strictDeps = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "mistweaverco";
repo = "kulala-core";
tag = "v${finalAttrs.version}";
hash = "sha256-qEPJFd1/C9F8oyUTx3PMmRS9B8kdjQT9O0bfoalAJ/k=";
};
node_modules = stdenv.mkDerivation {
pname = "${finalAttrs.pname}-node_modules";
inherit (finalAttrs) version src;
strictDeps = true;
__structuredAttrs = true;
nativeBuildInputs = [
bun
writableTmpDirAsHomeHook
];
dontConfigure = true;
buildPhase = ''
runHook preBuild
export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
bun install \
--cpu="*" \
--frozen-lockfile \
--ignore-scripts \
--no-progress \
--os="*"
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -R node_modules $out/
runHook postInstall
'';
dontFixup = true;
outputHash = "sha256-NjHm6KU6Cd0ZyL1c+bmNbEHb5E83/xjQ5UGRjY1hzgQ=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
};
nativeBuildInputs = [
bun
makeWrapper
];
dontConfigure = true;
buildPhase = ''
runHook preBuild
cp -R ${finalAttrs.node_modules}/node_modules .
echo '{ "version": "${finalAttrs.version}" }' > packages/core/version.json
bun build src/cli.ts \
--define __KULALA_EMBED_CURL__=false \
--target bun \
--outfile dist/kulala-core.js \
--cwd packages/core
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm644 packages/core/dist/kulala-core.js $out/lib/kulala-core/kulala-core.js
makeWrapper ${lib.getExe bun} $out/bin/kulala-core \
--add-flags $out/lib/kulala-core/kulala-core.js \
--set KULALA_CURL_PATH ${lib.getExe curl}
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
kulalaResponse=$(
printf '%s' '{"action":"from_curl","curl":"curl https://example.com"}' | \
$out/bin/kulala-core
)
[[ "$kulalaResponse" = *'"ok": true'* ]]
[[ "$kulalaResponse" = *'GET https://example.com'* ]]
runHook postInstallCheck
'';
meta = {
description = "Core parser and runner for kulala.nvim";
homepage = "https://github.com/mistweaverco/kulala-core";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ khaneliman ];
mainProgram = "kulala-core";
platforms = bun.meta.platforms;
};
})