-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·38 lines (27 loc) · 992 Bytes
/
setup.sh
File metadata and controls
executable file
·38 lines (27 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -e
echo "Setting up nix darwin and home manager"
if ! command -v nix &>/dev/null; then
echo "Installing Nix"
sh <(curl -L https://nixos.org/nix/install)
echo "Nix installation complete. Please run this script again after restarting your terminal."
exit 0
fi
echo "Nix is available, continuing with setup..."
REPO_URL="https://github.com/jcha0713/dotfiles.git"
CONFIG_DIR="$HOME/dotfiles/"
BRANCH_NAME="nix"
if [ ! -d "$CONFIG_DIR" ]; then
echo "Cloning your configuration repository..."
git clone --branch "$BRANCH_NAME" "$REPO_URL" "$CONFIG_DIR"
else
echo "Configuration directory already exists. Pulling latest changes..."
cd "$CONFIG_DIR" && git pull
fi
if ! command -v darwin-rebuild &>/dev/null; then
echo "Installing Nix Darwin..."
nix run nix-darwin/master#darwin-rebuild --extra-experimental-features "nix-command flakes" -- switch --flake "$CONFIG_DIR#jcha_mini"
else
echo "Nix Darwin is already installed."
fi
echo "Setup complete!"