96f88b3047
- 移除所有 zsh 引用,补全 fish 迁移 - git.nix: 声明 userName/userEmail,删除 credential.helper store 和内网 sslVerify - 新增 programs.ssh 声明式配置(id_ed25519, addKeysToAgent) - 简化 install.sh 为 darwin/nixos 双平台
24 lines
530 B
Bash
Executable File
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."
|