Add development set up variables

This commit is contained in:
Χγφτ Kompanion 2025-10-19 21:09:22 +02:00
parent 3f1410a095
commit d39d20dd22
1 changed files with 71 additions and 0 deletions

71
dev.env Normal file
View File

@ -0,0 +1,71 @@
# Our prefix
export CUSTOM_PREFIX=$HOME/dev/metal
# Start with fresh variables
unset LD_LIBRARY_PATH
unset PKG_CONFIG_PATH
function trim_space {
sed -i 's/[[:space:]]*$//' "$@"
}
prepend() { [ -d "$2" ] && eval $1=\"$2\$\{$1:+':'\$$1\}\" && export $1 ; }
# CPU core count (portable)
_nproc() {
if command -v nproc >/dev/null 2>&1; then nproc
elif getconf _NPROCESSORS_ONLN >/dev/null 2>&1; then getconf _NPROCESSORS_ONLN
else echo 1; fi
}
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin
function addprefix()
{
prepend PATH "$1/bin"
prepend LD_LIBRARY_PATH "$1/lib"
prepend LD_LIBRARY_PATH "$1/lib64"
prepend LD_LIBRARY_PATH "$1/lib/x86_64-linux-gnu"
prepend PKG_CONFIG_PATH "$1/lib64/pkgconfig"
prepend PKG_CONFIG_PATH "$1/lib/pkgconfig"
prepend PKG_CONFIG_PATH "$1/lib/x86_64-linux-gnu/pkgconfig"
prepend CMAKE_PREFIX_PATH "$1"
prepend CMAKE_PREFIX_PATH "$1/lib/cmake"
prepend CMAKE_PREFIX_PATH "$1/lib/x86_64-linux-gnu/cmake"
prepend CMAKE_MODULE_PATH "$1/lib/x86_64-linux-gnu/cmake"
prepend PYTHONPATH "$1/lib/python3.13"
}
addprefix $CUSTOM_PREFIX
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
# npm local (“global”) installs under CUSTOM_PREFIX
export NPM_CONFIG_PREFIX="$CUSTOM_PREFIX"
export NODE_PATH="$CUSTOM_PREFIX/lib/node_modules"
# Load a common venv
source $CUSTOM_PREFIX/pyenv/bin/activate
export PS1="(metal) $PS1"
# required for devfunctions
export BUILD_PREFIX=$CUSTOM_PREFIX/build
export SRC_PREFIX=$CUSTOM_PREFIX/src
source ~/scripts/devfunctions.sh
export MODELS=/mnt/data/models
export PG_DSN='postgresql://kompanion/kompanion?host=/var/run/postgresql'
export OLLAMA_MODELS="/mnt/bulk/models/ollama"
export OLLAMA_BASE_URL=127.0.0.1:11434
export LC_ALL=en_US.UTF-8
export QT_PLUGIN_PATH=$CUSTOM_PREFIX/lib/plugins:$CUSTOM_PREFIX/lib64/plugins:$CUSTOM_PREFIX/lib/x86_64-linux-gnu/qt6/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=$CUSTOM_PREFIX/lib/qml:$CUSTOM_PREFIX/lib64/qml:$CUSTOM_PREFIX/lib/x86_64-linux-gnu/qml:$QTDIR/qml
export QML_IMPORT_PATH=$QML2_IMPORT_PATH
export LD_LIBRARY_PATH
export PKG_CONFIG_PATH
export CMAKE_PREFIX_PATH
export CMAKE_MODULE_PATH
export QT_MESSAGE_PATTERN=%{time h:mm:ss.zzz}%{if-category} %{category}:%{endif} %{if-debug}%{function}%{endif}%{if-warning}%{backtrace depth=5}%{endif}%{if-critical}%{backtrace depth=3}%{endif}%{if-fatal}%{backtrace depth=3}%{endif} %{message}