# -*- mode: sh; -*- # Thanks export_function() { local name=$1 local alias_dir=$PWD/.direnv/aliases mkdir -p "$alias_dir" PATH_add "$alias_dir" local target="$alias_dir/$name" if declare -f "$name" >/dev/null; then echo "#!$SHELL" > "$target" declare -f "$name" >> "$target" 2>/dev/null # Notice that we add shell variables to the function trigger. echo "$name \$*" >> "$target" chmod +x "$target" fi } use_guix() { # Recreate a garbage collector root. gcroots="$HOME/.config/guix/gcroots" mkdir -p "$gcroots" gcroot="$gcroots/guix" if [ -L "$gcroot" ] then rm -v "$gcroot" fi # Miscellaneous packages. ENVIRONMENTS=( weechat ) # Environment packages. PACKAGES=( autoconf autoconf-archive automake libtool make cmake gcc-toolchain pkg-config patchelf weechat libxml2 libstrophe glib libsignal-protocol-c sqlite ) # Thanks eval "$(guix environment --search-paths --root="$gcroot" ${ENVIRONMENTS[@]} --ad-hoc ${PACKAGES[@]} "$@")" export CC=gcc } use guix --with-debug-info=weechat --with-debug-info=libstrophe gdb