Files
nix-config/scripts/install.sh
T
imbytecat 96f88b3047 chore: 清除 zsh 残留,声明式 git 身份与 SSH config
- 移除所有 zsh 引用,补全 fish 迁移
- git.nix: 声明 userName/userEmail,删除 credential.helper store 和内网 sslVerify
- 新增 programs.ssh 声明式配置(id_ed25519, addKeysToAgent)
- 简化 install.sh 为 darwin/nixos 双平台
2026-04-10 21:58:55 +08:00

24 lines
530 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
REPO_URL="https://git.furtherverse.com/imbytecat/nix-config.git"
CONFIG_DIR="$HOME/.config/nix-config"
if [[ -d "$CONFIG_DIR/.git" ]]; then
git -C "$CONFIG_DIR" pull
else
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"
;;
Linux)
sudo nixos-rebuild switch --flake "$CONFIG_DIR#wsl"
;;
esac
echo "Done! Restart your shell."