Personal system configuration using Nix Flakes, Home Manager, and nix-darwin.
These steps are for a new Apple Silicon macOS machine.
Install Apple's Command Line Developer Tools before cloning this repo. Running
git on a fresh macOS install may also show the installer prompt.
xcode-select --installThis installs git and other build tools. It can take around 10 minutes.
Create an SSH key and register the public key in GitHub.
ssh-keygen -t rsa
pbcopy < ~/.ssh/id_rsa.pubAdd the copied key to GitHub, then clone this repo over SSH. Most submodules use SSH URLs, so HTTPS clone is not enough for a full setup.
git clone git@github.com:Ja-sonYun/dotfiles.git
cd dotfiles
git submodule update --init --recursiveInstall Nix, then restart macOS or start a new shell so the Nix environment is loaded.
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install)Install Rosetta before deploying because this config manages Homebrew packages.
softwareupdate --install-rosetta --agree-to-licenseAdd Terminal to:
System Settings > Privacy & Security > App Management
Enter a bootstrap shell with the tools needed before the managed environment is available.
nix-shell -p ripgrep coreutils gnused gitBack up the stock shell rc files before the first nix-darwin activation. The
activation creates managed /etc/zshrc and /etc/bashrc files.
sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin
sudo mv /etc/zshrc /etc/zshrc.before-nix-darwinmake deployOn macOS, make deploy applies the nix-darwin configuration for the current host name.
make update # Update flakes and packages
make deploy # Apply configuration