if ! has nix_direnv_version || ! nix_direnv_version 2.4.0; then
    source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.4.0/direnvrc" "sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U="
fi

watch_file pyproject.toml poetry.lock
watch_file nix/commands.nix nix/letsql.nix nix/nix.conf

# within this repo, we want to control the nix.conf contents
export NIX_CONF_DIR=$(realpath ./nix)
export NIX_USER_CONF_FILES=$(realpath ./nix)
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring

source_env_if_exists .envrc.secrets
source_env_if_exists .envrc.user
