Skip to content

feat: build claude-code from source for version control#112

Merged
ncrmro merged 4 commits intomainfrom
build-claude-code-from-source
Jan 22, 2026
Merged

feat: build claude-code from source for version control#112
ncrmro merged 4 commits intomainfrom
build-claude-code-from-source

Conversation

@ncrmro
Copy link
Collaborator

@ncrmro ncrmro commented Jan 22, 2026

Summary

  • Add local claude-code package in nix/claude-code/ mirroring upstream nixpkgs
  • Add update shell command to update claude-code and flake inputs
  • Add GitHub Action to auto-create PRs when new claude-code versions are released

Why

The nixpkgs claude-code package can lag behind npm releases. This gives us control over the version and enables automatic updates.

Files

File Purpose
nix/claude-code/package.nix Package definition (mirrors nixpkgs)
nix/claude-code/package-lock.json npm lockfile
nix/claude-code/update.sh Update script (sync from nixpkgs or npm)
nix/update Shell command to update all deps
.github/workflows/update-claude-code.yml Daily cron to check for updates

Usage

# In dev shell
update              # Update claude-code + flake inputs

# Manual update
./nix/claude-code/update.sh          # Sync from nixpkgs
./nix/claude-code/update.sh --manual # Update from npm directly

Test plan

  • nix develop builds successfully
  • claude --version returns 2.1.15
  • update command is available in PATH

🤖 Generated with Claude Code

ncrmro and others added 2 commits January 22, 2026 11:52
- Add local claude-code package in nix/claude-code/
- Mirror upstream nixpkgs package definition
- Add update.sh script to sync from nixpkgs or npm
- Add nix/update command for easy dependency updates
- Add GitHub Action to auto-create PRs for new versions

This allows staying current with claude-code releases
independent of nixpkgs update cycles.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ncrmro and others added 2 commits January 22, 2026 12:41
- Rewrite update.sh to fetch directly from npm and compute hashes
  automatically using prefetch-npm-deps
- Remove nixpkgs sync option (--manual flag removed)
- Simplify GitHub workflow by letting the script handle version checking
- Update CONTRIBUTING.md to reflect the simplified process

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ncrmro ncrmro merged commit 824e756 into main Jan 22, 2026
4 checks passed
@ncrmro ncrmro deleted the build-claude-code-from-source branch January 22, 2026 19:06
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.

2 participants