aboutsummaryrefslogtreecommitdiffstats
path: root/.envrc
diff options
context:
space:
mode:
Diffstat (limited to '.envrc')
-rw-r--r--.envrc20
1 files changed, 20 insertions, 0 deletions
diff --git a/.envrc b/.envrc
new file mode 100644
index 00000000..9b41f79b
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,20 @@
+# this is required for versions of direnv older than 2.29.0, since they do not
+# support `use flake`, and is recommended in all cases, since it caches the
+# environment and prevents dependencies from being garbage-collected by nix.
+if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
+ source_url \
+ "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" \
+ "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
+fi
+
+# allow extending this .envrc with a user-defined .envrc.local
+source_env_if_exists .envrc.local
+
+# load the development shell defined in the flake.nix file
+# note: this automatically watches the following files:
+# - flake.nix
+# - flake.lock
+use flake
+
+# files to watch
+watch_file .envrc.local