Something went wrong. Try again.
npx ccusage
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114{ inputs, lib, ... }:let root = ./..;in{ perSystem = { config, system, ... }: let pkgs = import inputs.nixpkgs { inherit system; overlays = [ inputs.rust-overlay.overlays.default ]; }; rustToolchain = pkgs.rust-bin.fromRustupToolchainFile (root + /rust-toolchain.toml); gitWtHook = import ./git-wt.nix { inherit pkgs; }; in { devShells.default = pkgs.mkShell { # Hand cargo the pinned LiteLLM snapshot the way the Nix packages do, so # `cargo build` in the dev shell stays offline and does not need the # fetch-litellm-pricing feature's rustls stack. CCUSAGE_PRICING_JSON_PATH = "${inputs.litellm}/model_prices_and_context_window.json";
buildInputs = (with pkgs; [ nodejs pnpm bun inputs.bun2nix.packages.${system}.default nushell config.packages.cargo-hawk config.packages.publint
rustToolchain cargo-edit cargo-insta cargo-llvm-cov pkg-config openssl config.treefmt.build.wrapper nixfmt deadnix statix typos typos-lsp oxfmt actionlint zizmor oxlint just prek gitleaks renovate jq git git-wt gh hyperfine similarity ast-grep ripgrep fd fzf delta dust ]) ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ pkgs.mold ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.apple-sdk_15 ] ++ config.pre-commit.settings.enabledPackages;
shellHook = '' if [ "$(uname -s)" = "Linux" ]; then case " ''${RUSTFLAGS:-} " in *" -C link-arg=-fuse-ld=mold "*) ;; *) export RUSTFLAGS="''${RUSTFLAGS:+$RUSTFLAGS }-C link-arg=-fuse-ld=mold" ;; esac fi
# Install whenever a lockfile is newer than the last `just install`, so # a `git pull` that bumps dependencies does not leave a stale tree. The # `.envrc` watches pnpm-lock.yaml and the whole nix/ tree, so direnv # re-enters the shell — and re-runs this check — as soon as one changes. # The tool dirs under nix/tools are outside the pnpm workspace, hence # the extra lockfiles. needsInstall=false if [ ! -e node_modules/.install-stamp ]; then needsInstall=true else for lock in pnpm-lock.yaml nix/tools/*/bun.lock; do if [ "$lock" -nt node_modules/.install-stamp ]; then needsInstall=true fi done fi if [ "$needsInstall" = true ]; then echo "Installing dependencies..." just install fi
${lib.getExe config.packages.syncAgentSkills} ${config.pre-commit.shellHook} '' + gitWtHook; }; };}