#!/usr/bin/env bash set -e echo "=> Ensuring local config stubs exist..." touch ~/.local_env.nu ~/.local.nu echo "=> Running smoke test on Nushell config..." nu -c "source ~/.dotfiles/config/nushell/env.nu; source ~/.dotfiles/config/nushell/config.nu" || { echo "Smoke test failed! Fix Nushell config errors before applying." exit 1 } echo "=> Smoke test passed. Applying home-manager configuration..." if [[ "$(uname -s)" == "Darwin" ]]; then TARGET="mac" else TARGET="linux" fi home-manager switch --flake .#$TARGET -b "backup-$(date +%s)" echo "=> Done."