feat: Add Nix flake support for building and distributing seam-cli - #633
Merged
Conversation
Package the standalone binary with buildNpmPackage and importNpmLock so npm remains the only dependency lockfile: importNpmLock feeds the existing package-lock.json to npm offline, and bun compiles src/bin/cli.ts the same way the release workflow does. The compile itself moves into a new build:standalone npm script, so the Nix build runs the project's own build command instead of restating the bun invocation. Its output is the Bun runtime with the JavaScript bundle appended, which neither strip nor patchelf can touch without losing the bundle, so both fixup steps stay off. Only the compiled executable is installed, so nothing in the closure needs Node.js. The flake covers every platform Nixpkgs' bun runs on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
An earlier edit rewrote the file through a text-mode round trip, which turned the two carriage returns the macOS Icon\r\r entry needs into newlines and stopped it matching. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
The attribute, the derivation, and the program it installs now all agree, and nothing in Nixpkgs claims the name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
npm chains it the same way the other build scripts here are chained, instead of an && in the script body. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
installShellCompletion puts the same loaders that seam completion --install writes into the profile, so NixOS and Home Manager pick them up without a second step, and they still resolve to whatever schema the installed binary carries. Each installation section in the README now says what it does about completions, rather than deferring to a note under the last one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
Only the fixup settings keep one, since nothing about dontStrip and dontPatchELF says why they are there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
npm and a manual download need the command. The packages that install completions themselves do not need to say so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1
razor-x
marked this pull request as ready for review
August 20, 2026 18:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Nix flake support to the seam-cli project, enabling users to build, run, and install the CLI using Nix package manager.
Key Changes
flake.nix: Defines a Nix flake with outputs for building seam-cli across multiple platforms (x86_64-linux, aarch64-linux, aarch64-darwin)flake.lock: Locks nixpkgs dependency to ensure reproducible buildspackage.nix: Implements the Nix package definition usingbuildNpmPackage, which:build:standalonenpm script$out/binbuild:standalonenpm script: Uses Bun to compilesrc/bin/cli.tsinto a single-file executablenix run) and installing (nix profile install) the CLI.gitignore: Added entries for the standaloneseambinary and Nix build artifacts (result,result-*)Implementation Details
The Nix package leverages Bun's native compilation capabilities to create a self-contained executable. Special care is taken to preserve the executable's integrity by disabling standard post-build transformations (stripping and ELF patching) that would corrupt the appended JavaScript bundle.
https://claude.ai/code/session_011VWSk3QX5mCMRJ6PhsJqC1