# Bootstrap nix-direnv so `use flake` is GC-root cached and only re-evaluates
# when flake.nix / flake.lock actually change. Without this, stock direnv
# re-evaluates the whole flake on every shell entry (multi-second cost per
# reload). nix-direnv builds a profile at .direnv/flake-profile-* and only
# invalidates when the flake itself moves.
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
  source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" \
    "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi

use flake
