#!/usr/bin/env bash

set -euo pipefail

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

nix_direnv_watch_file rust-toolchain.toml
use flake

# Does not work, but leaving in case it starts working.
export RUST_POST_PROCESS_FILE="cargo fmt"
