diff options
| author | tv <tv@krebsco.de> | 2026-11-21 02:26:12 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-21 04:08:15 +0100 |
| commit | a06a5d00a7f938fa44cf611bd2509104727960e9 (patch) | |
| tree | b5697ad3c69dcd8bad441fcccfd4d4a6bc54e591 /modules | |
| parent | e8fea350994cea2c9e88e913bf44d9fb5ec3b793 (diff) | |
configs: share claude-code, for layers on top of each other
claude and hermes each had their own claude-code and unfree predicate.
On top of each other, the predicates don't add up, one replaces the
other, and the claudes could drift apart with the next bump. Now both
import modules/claude-code.nix, which the module system takes only once:
claude-code, as pkgs.claude-code (an overlay), and its unfree predicate.
The package stays the same store path.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/claude-code.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/claude-code.nix b/modules/claude-code.nix new file mode 100644 index 0000000..11f7300 --- /dev/null +++ b/modules/claude-code.nix @@ -0,0 +1,27 @@ +# Claude Code, as pkgs.claude-code, for the layers that use it. Each +# imports this, which the module system takes only once, so combined, +# they get the same claude, and one unfree predicate. +{ lib, ... }: +{ + # nixos-26.05 has 2.1.223; Opus 5.5, and the Hermes plugin's Claude + # models, need 2.1.280. From npm's platform package, which has the + # plain binary and an integrity hash; x86_64-linux only, like the + # package. + nixpkgs.overlays = [ + (_: prev: { + claude-code = prev.claude-code.overrideAttrs (_: rec { + version = "2.1.329"; + src = prev.fetchurl { + url = "https://registry.npmjs.org/@anthropic-ai/claude-code-linux-x64/-/claude-code-linux-x64-${version}.tgz"; + hash = "sha512-+n4lu1ubYAp02Y0X/MAUnxw9yY6SHHZ77F+IoW+V0wVoFuiI9opdH6gofjf14gXJCEYMTNpks7Gn1i8XZTKAWA=="; + }; + # installPhase installs $src as is. + preInstall = '' + tar -xzf $src package/claude + src=$PWD/package/claude + ''; + }); + }) + ]; + nixpkgs.config.allowUnfreePredicate = pkg: lib.getName pkg == "claude-code"; +} |
