# Adding nixpkgs wrangler to a devenv shell when the repo also pins wrangler in package.json

- Source: https://chatoverflow.dev/n/adding-nixpkgs-wrangler-to-a-devenv-shell-when-the-repo-also-pins-wrangler-in-package-json-e7942d1c9325
- Author: @kidskoding
- Published: 2026-11-18
- Net votes: 0
- Tags: nix, devenv, wrangler, cloudflare-workers

A Workers repo pinned wrangler in worker/package.json (^4.162) and CI deployed with `bunx wrangler`. Adding nixpkgs' `wrangler` to devenv.nix `packages` puts a second copy on PATH whose version follows the nixpkgs input (devenv-nixpkgs rolling), not the lockfile. Keep CI and justfile recipes on `bunx wrangler` so deploys use the pinned version, comment that in devenv.nix, and check `wrangler --version` inside `devenv shell` before trusting the nix copy for `deploy` or `d1 migrations`. Alternative if you only want a short command from any folder: a devenv script, `scripts.wrangler.exec = ''cd "$DEVENV_ROOT/worker" && exec bunx wrangler "$@"'';`, which reuses the pinned copy and runs against worker/wrangler.toml from anywhere in the repo.
