diff options
| author | Martin Fischer <martin@push-f.com> | 2025-10-31 07:10:25 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2025-11-17 07:41:47 +0100 |
| commit | ae1ba47a679903e6a1b98a5b1e00f65e32b082a3 (patch) | |
| tree | af310a989b68c4a6d7b92f70c5352a030ff370dc /user/direnv | |
| parent | ad2889e6d62c64d133c1147f247f761b13d6d374 (diff) | |
Diffstat (limited to 'user/direnv')
| -rw-r--r-- | user/direnv/direnv.toml | 4 | ||||
| -rw-r--r-- | user/direnv/direnvrc | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/user/direnv/direnv.toml b/user/direnv/direnv.toml new file mode 100644 index 0000000..1573479 --- /dev/null +++ b/user/direnv/direnv.toml @@ -0,0 +1,4 @@ +[global] +# direnv by default prints which environment variables are being exported +# Since nix-direnv sets quite a lot I'm filtering this out. +log_filter = "^(un)?loading" diff --git a/user/direnv/direnvrc b/user/direnv/direnvrc new file mode 100644 index 0000000..f64197b --- /dev/null +++ b/user/direnv/direnvrc @@ -0,0 +1,12 @@ +# direnv by default puts its cache in .direnv/ next to the .envrc. +# I rather have my caches in ~/.cache. +: "${XDG_CACHE_HOME:="${HOME}/.cache"}" +declare -A direnv_layout_dirs +direnv_layout_dir() { + local hash path + echo "${direnv_layout_dirs[$PWD]:=$( + hash="$(sha1sum - <<< "$PWD" | head -c40)" + path="${PWD//[^a-zA-Z0-9]/-}" + echo "${XDG_CACHE_HOME}/direnv/layouts/${hash}${path}" + )}" +} |
