Use another git config for work machine

This commit is contained in:
2026-03-17 21:14:47 +01:00
parent ae92b5f392
commit 6c72d0b4bf
30 changed files with 55 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
# Place in ~/.config/direnv/direnvrc
# Two things to know:
# * `direnv_layour_dir` is called once for every {.direnvrc,.envrc} sourced
# * The indicator for a different direnv file being sourced is a different $PWD value
# This means we can hash $PWD to get a fully unique cache path for any given environment
: ${XDG_CACHE_HOME:=$HOME/.cache}
declare -A direnv_layout_dirs
direnv_layout_dir() {
echo "${direnv_layout_dirs[$PWD]:=$(
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
echo -n "$PWD" | sha1sum | cut -d ' ' -f 1
)}"
}