-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.envrc
More file actions
23 lines (19 loc) · 688 Bytes
/
Copy path.envrc
File metadata and controls
23 lines (19 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# shellcheck shell=bash
# vi: ft=sh
# Source .env if it is present
dotenv_if_exists
# Reload environment on any changes to Nix sources. Generated lockfile-style
# Nix (Cargo.nix, bun.nix) is excluded: the devShell does not depend on it, and
# watching it forces a full reload during update runs for nothing.
mapfile -d '' -t nix_files < <(fd -0 -tf -enix -E Cargo.nix -E bun.nix)
if [[ ${#nix_files[@]} -gt 0 ]]; then
watch_file "${nix_files[@]}"
fi
unset nix_files
# Activate direnv Nix integration, using the root flake
use flake
# Activate Python venv if present
if [[ -f "${PWD}/.venv/bin/activate" ]]; then
# shellcheck disable=SC1091
source "${PWD}/.venv/bin/activate"
fi