Compare commits
3 Commits
a7ddc90e17
...
bb3c53b40b
| Author | SHA1 | Date | |
|---|---|---|---|
| bb3c53b40b | |||
| 6c5fdd7331 | |||
| c7029a0d34 |
@@ -106,12 +106,14 @@ nix-overlay/
|
|||||||
│ ├── default.nix # Binary-cache-friendly overlay
|
│ ├── default.nix # Binary-cache-friendly overlay
|
||||||
│ └── shared-nixpkgs.nix # Dependency-sharing overlay
|
│ └── shared-nixpkgs.nix # Dependency-sharing overlay
|
||||||
├── packages/ # Package definitions
|
├── packages/ # Package definitions
|
||||||
|
│ ├── container-use/ # Containerized environments for coding agents
|
||||||
│ ├── default/ # Meta-package listing all packages
|
│ ├── default/ # Meta-package listing all packages
|
||||||
│ ├── desloppify/ # Codebase health scanner for AI agents
|
│ ├── desloppify/ # Codebase health scanner for AI agents
|
||||||
│ ├── freebuff/ # Free coding agent (Codebuff)
|
|
||||||
│ ├── flake-inputs/ # Utility for caching flake inputs
|
│ ├── flake-inputs/ # Utility for caching flake inputs
|
||||||
|
│ ├── freebuff/ # Free coding agent (Codebuff)
|
||||||
│ ├── goose-cli/ # Goose AI agent CLI
|
│ ├── goose-cli/ # Goose AI agent CLI
|
||||||
│ ├── graphify/ # Knowledge graph generator for code folders
|
│ ├── graphify/ # Knowledge graph generator for code folders
|
||||||
|
│ ├── kubernetes-mcp-server/ # MCP server for Kubernetes and OpenShift
|
||||||
│ ├── mcp-gateway/ # MCP protocol gateway
|
│ ├── mcp-gateway/ # MCP protocol gateway
|
||||||
│ ├── radar/ # Kubernetes UI (topology, timeline, Helm, GitOps)
|
│ ├── radar/ # Kubernetes UI (topology, timeline, Helm, GitOps)
|
||||||
│ └── skillsmcp/ # MCP server for Agent Skills
|
│ └── skillsmcp/ # MCP server for Agent Skills
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ pkgs, ... }: pkgs.callPackage ./package.nix { }
|
{ pkgs, ... }: pkgs.callPackage ./package.nix { glibc = pkgs.stdenv.cc.libc; }
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
fetchurl,
|
fetchurl,
|
||||||
nodejs,
|
nodejs,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
|
patchelf,
|
||||||
|
glibc,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@@ -44,6 +46,11 @@ let
|
|||||||
hash = "sha256-fJ1D26t8qzsxM7Dmpa8UAUSCKFMWs57J9QjvrdnrzpU=";
|
hash = "sha256-fJ1D26t8qzsxM7Dmpa8UAUSCKFMWs57J9QjvrdnrzpU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
binarySrc = fetchurl {
|
||||||
|
url = "https://codebuff.com/api/releases/download/${version}/freebuff-linux-x64.tar.gz";
|
||||||
|
hash = "sha256-WRTEXqKDww4ZPAnDLAAkAd0jxl+z6+dRbcQORmN7QfM=";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@@ -52,13 +59,30 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
src = freebuffSrc;
|
src = freebuffSrc;
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper patchelf ];
|
||||||
|
|
||||||
|
dontStrip = true;
|
||||||
|
dontPatchelf = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p "$out/lib/node_modules/freebuff"
|
# Extract and patch the pre-built binary for NixOS compatibility
|
||||||
cp -r * "$out/lib/node_modules/freebuff/"
|
mkdir -p "$out/bin" /tmp/fb-engine
|
||||||
|
tar xzf "${binarySrc}" -C /tmp/fb-engine --strip-components=0
|
||||||
|
cp /tmp/fb-engine/freebuff "$out/bin/freebuff-engine"
|
||||||
|
chmod 755 "$out/bin/freebuff-engine"
|
||||||
|
|
||||||
|
patchelf \
|
||||||
|
--set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" \
|
||||||
|
--set-rpath "${glibc}/lib:" \
|
||||||
|
"$out/bin/freebuff-engine"
|
||||||
|
|
||||||
|
if [ -f /tmp/fb-engine/tree-sitter.wasm ]; then
|
||||||
|
cp /tmp/fb-engine/tree-sitter.wasm "$out/bin/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf /tmp/fb-engine
|
||||||
|
|
||||||
# Extract npm dependencies from pre-fetched tarballs
|
# Extract npm dependencies from pre-fetched tarballs
|
||||||
extractNpmPkg() {
|
extractNpmPkg() {
|
||||||
@@ -67,18 +91,40 @@ stdenv.mkDerivation rec {
|
|||||||
tar xzf "$src" -C "$target" --strip-components=1
|
tar xzf "$src" -C "$target" --strip-components=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mkdir -p "$out/lib/node_modules/tar"
|
||||||
|
mkdir -p "$out/lib/node_modules/chownr"
|
||||||
|
mkdir -p "$out/lib/node_modules/minipass"
|
||||||
|
mkdir -p "$out/lib/node_modules/minizlib"
|
||||||
|
mkdir -p "$out/lib/node_modules/yallist"
|
||||||
|
mkdir -p "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||||
|
|
||||||
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
||||||
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
||||||
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
||||||
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
||||||
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
||||||
mkdir -p "$out/lib/node_modules/@isaacs"
|
|
||||||
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||||
|
|
||||||
mkdir -p "$out/bin"
|
# Launcher: run the patched engine directly from nix-store
|
||||||
|
cat > "$out/bin/launcher.js" << LAUNCHER_EOF
|
||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawn } = require('child_process');
|
||||||
|
const TERMINAL_RESET = '\x1b[?1049l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[?25h';
|
||||||
|
const engine = '${placeholder "out"}/bin/freebuff-engine';
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
try { if (process.stdin.isTTY && process.stdin.setRawMode) process.stdin.setRawMode(false); } catch(e){}
|
||||||
|
try { if (process.stdout.isTTY) process.stdout.write(TERMINAL_RESET); } catch(e){}
|
||||||
|
}
|
||||||
|
|
||||||
|
const child = spawn(engine, process.argv.slice(2), { stdio: 'inherit' });
|
||||||
|
child.on('exit', (code, signal) => { reset(); process.exit(signal ? 1 : code || 0); });
|
||||||
|
child.on('error', (e) => { console.error('Failed to start freebuff:', e.message); process.exit(1); });
|
||||||
|
LAUNCHER_EOF
|
||||||
|
|
||||||
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
||||||
--set NODE_PATH "$out/lib/node_modules" \
|
--set NODE_PATH "$out/lib/node_modules" \
|
||||||
--add-flags "$out/lib/node_modules/freebuff/index.js"
|
--add-flags "$out/bin/launcher.js"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
@@ -99,6 +145,6 @@ stdenv.mkDerivation rec {
|
|||||||
homepage = "https://codebuff.com";
|
homepage = "https://codebuff.com";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
mainProgram = "freebuff";
|
mainProgram = "freebuff";
|
||||||
platforms = platforms.all;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user