feat: add claude-code package

- Add Nix package for @anthropic-ai/claude-code (v2.1.59)
- Add package-lock.json with optional dependencies for all platforms
- Include update script for automated version updates
- Add module integration with custom package reference
- Rename claude shell alias to claude-custom

Refs: https://github.com/anthropics/claude-code
This commit is contained in:
2026-02-26 08:49:13 -05:00
parent ff5cd52dce
commit 8e1a2ad85a
6 changed files with 434 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
# claude-code
Nix package for [@anthropic-ai/claude-code](https://www.npmjs.com/package/@anthropic-ai/claude-code).
## Updating
1. Fetch the tarball and generate a `package-lock.json`:
```bash
mkdir /tmp/claude-update && cd /tmp/claude-update
npm pack @anthropic-ai/claude-code@<version>
tar -xf anthropic-ai-claude-code-<version>.tgz
cd package
npm install --package-lock-only --ignore-scripts
```
2. Copy the lockfile into the package directory:
```bash
cp package-lock.json /path/to/nixpkgs/pkgs/by-name/cl/claude-code/package-lock.json
```
3. Update the `version` and `hash` fields in `package.nix`. Set `hash` to `lib.fakeHash` temporarily, then build to get the correct hash:
4. Do the same for `npmDepsHash`: