if [ -f .nix-env.rc ]; then
  source .nix-env.rc
else
  use flake
fi

if [ "$ANTIGRAVITY_AGENT" = "1" ]; then
  export CARGO_HOME=$(dirname "$PWD")/.cargo
  unset NIX_SSL_CERT_FILE
fi

export ZENA_PROJECT_CACHE=1
export PATH=$HOME/.nix-profile/bin:$PATH

# Preserve IDE terminal sandbox proxy and cert configuration
export HTTP_PROXY=$HTTP_PROXY
export HTTPS_PROXY=$HTTPS_PROXY
export http_proxy=$http_proxy
export https_proxy=$https_proxy
export SSL_CERT_FILE=$SSL_CERT_FILE
export CURL_CA_BUNDLE=$CURL_CA_BUNDLE
if [ -n "$SSL_CERT_FILE" ]; then
  export CARGO_HTTP_CAINFO=$SSL_CERT_FILE
fi
