feat: add freebuff package (Codebuff AI coding agent)
Some checks failed
CI / check (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
Add freebuff v0.0.85 from npm registry — a pure JS CLI tool for AI-assisted coding. Pre-fetches all transitive npm dependencies to work within the Nix sandbox (no network access during build).
This commit is contained in:
1
packages/freebuff/default.nix
Normal file
1
packages/freebuff/default.nix
Normal file
@@ -0,0 +1 @@
|
||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
||||
104
packages/freebuff/package.nix
Normal file
104
packages/freebuff/package.nix
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
nodejs,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "0.0.85";
|
||||
|
||||
freebuffSrc = fetchurl {
|
||||
url = "https://registry.npmjs.org/freebuff/-/freebuff-${version}.tgz";
|
||||
hash = "sha256-1x593yLMkoFIO5O+k5NKeEpi729VhINQlW1xFbYGnXM=";
|
||||
};
|
||||
|
||||
pkgTar = fetchurl {
|
||||
url = "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz";
|
||||
hash = "sha256-hl60jJtM1W2THQyGZj8G72GEG8QvVrHvNnr7EU1liBw=";
|
||||
};
|
||||
|
||||
pkgFsMinipass = fetchurl {
|
||||
url = "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz";
|
||||
hash = "sha256-esKG48zMHqiYDnniA53va7l9MYLheVHNkJTwQA7ZgjY=";
|
||||
};
|
||||
|
||||
pkgChownr = fetchurl {
|
||||
url = "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz";
|
||||
hash = "sha256-TCT12qYwFCJS2oneZV998JDqR5RQqIJYl3UdeDIbE2A=";
|
||||
};
|
||||
|
||||
pkgMinipass = fetchurl {
|
||||
url = "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz";
|
||||
hash = "sha256-UqxhvnQ3VeP9yY5WAIbQ1KHix/02Qzh3kts44yLSfRI=";
|
||||
};
|
||||
|
||||
pkgMinizlib = fetchurl {
|
||||
url = "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz";
|
||||
hash = "sha256-mb8uKWGBct1x8GVHN0kMaPcbx+I3nUc+OPn+8tvs4uM=";
|
||||
};
|
||||
|
||||
pkgYallist = fetchurl {
|
||||
url = "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz";
|
||||
hash = "sha256-fJ1D26t8qzsxM7Dmpa8UAUSCKFMWs57J9QjvrdnrzpU=";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "freebuff";
|
||||
version = "0.0.85";
|
||||
|
||||
src = freebuffSrc;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out/lib/node_modules/freebuff"
|
||||
cp -r * "$out/lib/node_modules/freebuff/"
|
||||
|
||||
# Extract npm dependencies from pre-fetched tarballs
|
||||
extractNpmPkg() {
|
||||
local src="$1" target="$2"
|
||||
mkdir -p "$target"
|
||||
tar xzf "$src" -C "$target" --strip-components=1
|
||||
}
|
||||
|
||||
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
||||
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
||||
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
||||
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
||||
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
||||
mkdir -p "$out/lib/node_modules/@isaacs"
|
||||
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||
|
||||
mkdir -p "$out/bin"
|
||||
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
||||
--set NODE_PATH "$out/lib/node_modules" \
|
||||
--add-flags "$out/lib/node_modules/freebuff/index.js"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
category = "AI Coding Agents";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#freebuff"
|
||||
];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "The world's strongest free coding agent";
|
||||
homepage = "https://codebuff.com";
|
||||
license = licenses.mit;
|
||||
mainProgram = "freebuff";
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user