Skip to content

feat: add Nix flake for native Nix/NixOS installation#331

Open
uxtechie wants to merge 1 commit into
colbymchenry:mainfrom
uxtechie:implement-nix-flake-support
Open

feat: add Nix flake for native Nix/NixOS installation#331
uxtechie wants to merge 1 commit into
colbymchenry:mainfrom
uxtechie:implement-nix-flake-support

Conversation

@uxtechie
Copy link
Copy Markdown

Summary

Resolves #324 — the curl|sh install scripts don't work under Nix (FHS paths like ~/.local/bin aren't on $PATH, and Nix's immutable store is incompatible with imperative installers).

This adds a flake.nix so Nix/NixOS users can install codegraph natively.

Changes

File Description
flake.nix Nix flake with buildNpmPackage derivation + dev shell
flake.lock Auto-generated lock file (nixpkgs-unstable + flake-utils)
.gitignore Added result (Nix build output symlink)

Details

Usage

# Run directly
nix run github:colbymchenry/codegraph

# Install to profile
nix profile install github:colbymchenry/codegraph

# Use in another flake / NixOS config
inputs.codegraph.url = "github:colbymchenry/codegraph";

# Development shell
nix develop github:colbymchenry/codegraph

Verification

  • nix build .#default — builds successfully
  • ./result/bin/codegraph --version0.9.3
  • ./result/bin/codegraph --help → full command list
  • --liftoff-only present in wrapper script
  • nix flake check — all systems evaluate cleanly

Note for future releases

When package-lock.json changes, the npmDepsHash in flake.nix must be updated. Workflow: set hash to "", run nix build, copy the correct hash from the error.

Resolves colbymchenry#324 — the curl|sh install scripts don't work under Nix
(FHS paths like ~/.local/bin aren't on $PATH).

The flake provides:
- packages.default: codegraph built with buildNpmPackage (Node.js 24)
- devShells.default: development shell with Node.js 24

The wrapper injects --liftoff-only to prevent the V8 turboshaft WASM
Zone OOM (issues colbymchenry#293/colbymchenry#298), matching the existing bundle launcher.

Supports linux and darwin on both x86_64 and aarch64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nix flake please?

1 participant