diff --git a/.gitignore b/.gitignore index 44b25574..a64b4516 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .direnv /.pre-commit-config.yaml +/result +/result-* diff --git a/modules/home/development.nix b/modules/home/development.nix index b531c758..e462bf65 100644 --- a/modules/home/development.nix +++ b/modules/home/development.nix @@ -27,6 +27,11 @@ in { config = lib.mkMerge [ (mkIf cfg.ai.enable { + programs.zsh.sessionVariables = { + # Disable claude-pace API fallback; rate limits come from stdin on CC >= 2.1.80 + CLAUDE_PACE_API_FALLBACK = "0"; + }; + programs.mcp = { enable = true; servers.glyph = { @@ -42,6 +47,10 @@ in { model = "sonnet"; # Disabled in favor of Basic Memory MCP for cross-device access autoMemoryEnabled = false; + statusLine = { + type = "command"; + command = "${pkgs.claude-pace}/bin/claude-pace"; + }; permissions = { allow = [ # Nix store (read-only access for inspecting derivations and build outputs) diff --git a/overlays/custom-packages.nix b/overlays/custom-packages.nix index 9e7515bc..94ce6878 100644 --- a/overlays/custom-packages.nix +++ b/overlays/custom-packages.nix @@ -1,6 +1,9 @@ # Custom package definitions # These are packages not available in nixpkgs or requiring customization self: super: { + # Pace-aware statusline for Claude Code + claude-pace = super.callPackage ./../packages/claude-pace/package.nix {}; + # Claude desktop app claude-desktop = super.callPackage ./../packages/claude-desktop/package.nix {}; diff --git a/packages/claude-pace/package.nix b/packages/claude-pace/package.nix new file mode 100644 index 00000000..d6e662fe --- /dev/null +++ b/packages/claude-pace/package.nix @@ -0,0 +1,38 @@ +{ + lib, + fetchFromGitHub, + stdenv, + makeWrapper, + curl, + git, + jq, +}: +stdenv.mkDerivation rec { + pname = "claude-pace"; + version = "0.7.3"; + + src = fetchFromGitHub { + owner = "Astro-Han"; + repo = "claude-pace"; + rev = "v${version}"; + hash = "sha256-88qKvC+8Fu2IvBkU3SGbCj2tL78kh4yux4fUE1mo5Jw="; + }; + + nativeBuildInputs = [makeWrapper]; + + installPhase = '' + mkdir -p $out/bin + cp claude-pace.sh $out/bin/claude-pace + chmod +x $out/bin/claude-pace + wrapProgram $out/bin/claude-pace \ + --prefix PATH : ${lib.makeBinPath [curl git jq]} + ''; + + meta = with lib; { + description = "Pace-aware statusline for Claude Code with rate limit tracking and pace delta"; + homepage = "https://github.com/Astro-Han/claude-pace"; + license = licenses.mit; + mainProgram = "claude-pace"; + platforms = platforms.unix; + }; +}