Use direnv for automatic env config.

This commit is contained in:
2025-10-04 08:30:02 -07:00
parent d06e27931c
commit f94f80cd2a
3 changed files with 24 additions and 93 deletions

View File

@@ -0,0 +1,23 @@
# Set the WC_HOME environment variable to this script's directory.
# This variable is used consistently across the Wild Config scripts.
export WC_HOME="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
# Add bin to path first so wild-config is available
# export PATH="$WC_HOME/bin:$PATH"
export KUBECONFIG=$WC_HOME/.kubeconfig
export TALOSCONFIG=$WC_HOME/setup/cluster-nodes/generated/talosconfig
# Backup configuration.
if `wild-config cloud.backup.root --check`; then
export RESTIC_REPOSITORY="$(wild-config cloud.backup.root)"
else
echo "WARNING: Could not get cloud backup root."
fi
if `wild-secret cloud.backupPassword --check`; then
export RESTIC_PASSWORD="$(wild-secret cloud.backupPassword)"
else
echo "WARNING: Could not get cloud backup secret."
fi