fleetcode/flake.nix
Anish Lakhwara f75c054e65 update
2025-11-08 21:58:34 -08:00

138 lines
3.9 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "FleetCode - Multiple CLI coding agents development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
beads = {
url = "github:steveyegge/beads/v0.23.0";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, beads }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# Node.js and package managers
nodejs_20
# Electron (use nixpkgs version)
electron_38
# Build tools
git
(python3.withPackages (ps: with ps; [ setuptools ]))
pkg-config
# Beads - AI code review tool
beads.packages.${system}.default
# Native build dependencies for node-pty and Electron
gcc
gnumake
# Electron runtime dependencies
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libXScrnSaver
libdrm
mesa
gtk3
pango
cairo
gdk-pixbuf
atk
glib
nspr
nss
cups
dbus
expat
at-spi2-atk
at-spi2-core
libxkbcommon
alsa-lib
# Optional: Claude CLI if available
# (claude-cli)
];
shellHook = ''
echo "🚀 FleetCode development environment loaded"
echo ""
echo "📦 Setup (first time):"
echo " npm install - Install dependencies"
echo ""
echo "🌐 Web Server (recommended for remote access):"
echo " npm run server - Start web server on port 3000"
echo " PORT=8080 npm run server - Start on custom port"
echo ""
echo "🖥 Desktop App (Electron):"
echo " npx electron-rebuild - Rebuild for Electron"
echo " npm run dev - Run Electron app"
echo ""
echo "Note: Web server uses Node.js, desktop app uses Electron"
echo ""
# Set up Electron to find system libraries
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath (with pkgs; [
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libXScrnSaver
libdrm
mesa
gtk3
pango
cairo
gdk-pixbuf
atk
glib
nspr
nss
cups
dbus
expat
at-spi2-atk
at-spi2-core
libxkbcommon
alsa-lib
stdenv.cc.cc.lib
])}:$LD_LIBRARY_PATH"
# Disable Electron's sandbox for development
export ELECTRON_DISABLE_SANDBOX=1
# Set npm config for native builds
export npm_config_build_from_source=true
# Use system electron instead of npm package
export ELECTRON_OVERRIDE_DIST_PATH="${pkgs.electron_38}/bin/"
'';
};
}
);
}