1
0
Fork 0
dotfiles/home/config/direnv/direnvrc

92 lines
1.9 KiB
Text
Raw Permalink Normal View History

2022-01-09 16:23:33 +00:00
project() {
local cmd=$1
log_status "project $*"
shift
export PROJECT_DIR=$PWD
"project_$cmd" "$@"
}
# Languages
project_erlang() {
2024-05-25 13:47:17 +00:00
export ERL_AFLAGS="-kernel shell_history enabled -kernel shell_history_path '\"$(direnv_layout_dir)/erl_history\"'"
2022-01-09 16:23:33 +00:00
export REBAR_CACHE_DIR=$(direnv_layout_dir)/rebar
2022-02-05 22:31:11 +00:00
export REBAR_GLOBAL_CONFIG_DIR=$(direnv_layout_dir)/rebar/config
export REBAR_GLOBAL_CACHE_DIR=$(direnv_layout_dir)/rebar/cache
2022-01-09 16:23:33 +00:00
}
2022-11-08 23:24:54 +00:00
project_elixir() {
2022-01-09 16:23:33 +00:00
project_erlang
export MIX_HOME=$(direnv_layout_dir)/mix
export HEX_HOME=$(direnv_layout_dir)/hex
PATH_add $MIX_HOME/bin
PATH_add $HEX_HOME/bin
}
2022-11-08 23:24:54 +00:00
project_java() {
export M2_HOME=$(direnv_layout_dir)/m2
2022-11-15 23:42:33 +00:00
export GRADLE_HOME=$(direnv_layout_dir)/gradle
PATH_add $GRADLE_HOME/bin
2022-11-08 23:24:54 +00:00
}
2022-01-09 16:23:33 +00:00
project_node() {
export NODE_PATH=$(direnv_layout_dir)/node
2022-10-28 12:28:57 +00:00
export NPM_CONFIG_USERCONFIG=$(direnv_layout_dir)/npm/npmrc
2022-01-09 16:23:33 +00:00
export NPM_CONFIG_PREFIX=$(direnv_layout_dir)/npm/config
export NPM_CONFIG_CACHE=$(direnv_layout_dir)/npm/cache
export NPM_CONFIG_DEVDIR=$(direnv_layout_dir)/npm/dev
2022-04-14 14:39:35 +00:00
export YARN_ENABLE_TELEMETRY=false
2022-11-08 23:24:54 +00:00
export NEXT_TELEMETRY_DISABLED=1
2022-04-14 14:39:35 +00:00
2022-01-09 16:23:33 +00:00
PATH_add $NODE_PATH/bin
PATH_add node_modules/.bin
}
2022-05-31 13:46:57 +00:00
project_python() {
2023-10-14 17:55:29 +00:00
export PYTHONUSERBASE=$(direnv_layout_dir)/python-user
path_add PYTHONPATH $(realpath $PYTHONUSERBASE/lib/python*/site-packages)
2022-05-31 13:46:57 +00:00
export POETRY_HOME=$(direnv_layout_dir)/poetry/data
export POETRY_CACHE_DIR=$(direnv_layout_dir)/poetry/cache
2023-10-14 17:55:29 +00:00
PATH_add $PYTHONUSERBASE/bin
2022-05-31 13:46:57 +00:00
}
2022-01-09 16:23:33 +00:00
project_ruby() {
export GEM_HOME=$(direnv_layout_dir)/gem
export BUNDLE_USER_HOME=$(direnv_layout_dir)/bundle
PATH_add $GEM_HOME/bin
}
2023-08-16 23:19:16 +00:00
project_rust() {
export CARGO_HOME=$(direnv_layout_dir)/cargo
2023-08-29 19:45:09 +00:00
PATH_add $CARGO_HOME/bin
2023-08-16 23:19:16 +00:00
}
2022-01-09 16:23:33 +00:00
# Frameworks
2023-10-31 20:24:26 +00:00
project_phoenix() {
project_elixir
project_node
}
2022-01-09 16:23:33 +00:00
project_rails() {
project_ruby
project_node
}
2023-08-29 19:45:09 +00:00
project_tauri() {
project_rust
project_node
}