-# if guix is installed
-if [ -x "$(command -v guix)" ]; then
- export PATH="$HOME/.config/guix/current/bin:$PATH"
- export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
+if [ -z "$IS_GUIX_SYSTEM" ]; then
+ # if guix is installed
+ if [ -x "$(command -v guix)" ]; then
+ SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
+ if [ -d "$SSL_CERT_DIR" -o -h "$SSL_CERT_DIR" ]; then
+ export SSL_CERT_DIR
+ export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
+ else
+ printf "it seems you forgot to \`guix install nss-certs\'\n"
+ fi
+ GUIX_PROFILE="$HOME/.guix-profile"
+ . "$GUIX_PROFILE/etc/profile"
+ unset XDG_DATA_DIRS
+ fi
+fi
+
+for p in $MY_GUIX_PROFILES/*; do
+ profile=$p/$(basename "$p")
+ if [ -f "$profile"/etc/profile ]; then
+ GUIX_PROFILE="$profile"
+ . "$GUIX_PROFILE"/etc/profile
+ fi
+ unset profile
+done
+
+export PATH="$HOME/u/local/bin:$HOME/.local/bin:$PATH"