1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{ depot, pkgs, ... }:

pkgs.buildGoModule {
  name = "claude-usage";
  src = ./.;
  vendorHash = null;
  nativeBuildInputs = [ pkgs.makeWrapper ];
  # The program shells out to:
  #   - sqlite3, to read Firefox cookie databases;
  #   - curl, because Cloudflare blocks Go's stdlib TLS fingerprint (JA3/JA4)
  #     with a 403 challenge, whereas curl's handshake passes.
  postInstall = ''
    wrapProgram $out/bin/claude-usage \
      --set SQLITE3 '${pkgs.sqlite}/bin/sqlite3' \
      --set CURL '${pkgs.curl}/bin/curl'
  '';
}