fix: install.sh 路径改为 ~/Developer,首次 bootstrap 自动检测 darwin-rebuild

This commit is contained in:
2026-04-11 00:03:21 +08:00
parent e9146a4e4d
commit 52836c0490
2 changed files with 11 additions and 8 deletions
+7 -2
View File
@@ -2,18 +2,23 @@
set -euo pipefail
REPO_URL="https://git.furtherverse.com/imbytecat/nix-config.git"
CONFIG_DIR="$HOME/.config/nix-config"
CONFIG_DIR="$HOME/Developer/nix-config"
if [[ -d "$CONFIG_DIR/.git" ]]; then
git -C "$CONFIG_DIR" pull
else
mkdir -p "$HOME/Developer"
git clone "$REPO_URL" "$CONFIG_DIR"
fi
case "$(uname)" in
Darwin)
TARGET="${1:?Usage: $0 <mac-mini|macbook-air>}"
darwin-rebuild switch --flake "$CONFIG_DIR#$TARGET"
if command -v darwin-rebuild &>/dev/null; then
sudo darwin-rebuild switch --flake "$CONFIG_DIR#$TARGET"
else
sudo nix run nix-darwin -- switch --flake "$CONFIG_DIR#$TARGET"
fi
;;
Linux)
sudo nixos-rebuild switch --flake "$CONFIG_DIR#wsl"