Files
kyleandClaude Opus 5.5 c151a7516d direnv: enter the flake's dev shell on hosts with Nix
`.envrc` runs `use flake` when Nix is present, so on the NixOS hosts
(programs.direnv.enable brings direnv and nix-direnv) cd'ing into a
clone gives the pinned Rust toolchain, clippy, rustfmt, cargo-deny and
make; on titan, which has no Nix, it does nothing. nix-direnv's cache,
.direnv/, is ignored. Checked on straylight in a throwaway copy:
cargo 1.95.0, cargo-deny 0.19.6, rustc from the Nix store.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 23:12:55 -07:00

8 lines
350 B
Bash

# Enter the flake's dev shell (the Rust toolchain, clippy, rustfmt, cargo-deny, make) on hosts with
# Nix and direnv. NixOS hosts get both from `programs.direnv.enable`, which turns on nix-direnv and
# caches the shell under .direnv/. Run `direnv allow` once in each clone. Hosts without Nix (titan)
# are left alone.
if has nix; then
use flake
fi