- WSL 2 NixOS is enabled
- Ensure WSL is enabled.
wsl --install --no-distribution-
Download
nixos-wsl.tar.gzfrom the latest release -
Import the tarball into WSL 2
wsl --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz --version 2- Set NixOS as the default distro (optional - but recommended)
wsl --set-default NixOS- You can now run NixOS (
-d NixOSis not required because NixOS is default distro)
wsl- Clone the repo
nix-shell -p git --run 'git clone https://github.com/davethai/dotfiles.git ~/.dotfiles'- Apply the appropriate NixOS hostname configuration (ex:
dewgongis shown here) and shutdown the WSL 2 Virtual Machine (VM)
nix-shell -p git --run 'sudo nixos-rebuild switch --flake ~/.dotfiles/nix#dewgong'- Reconnect to WSL 2 VM
wsl- Nix package manager is installed
- Command Line Tools for Xcode
Install Nix
- Run the command below
sh <(curl -L https://nixos.org/nix/install)- Run the command below
xcode-select --install- Set git
nameandemail
git config --global user.name "Dave Thai"
git config --global user.email "[email protected]"- Clone dotfiles repo
nix-shell -p git --run 'git clone https://github.com/davethai/dotfiles.git ~/.dotfiles'-
Install Xcode from Mac App Store imperatively
-
Agree to Xcode License
sudo xcodebuild -license accept- Run
nix-darwinwithflake.nixand replace with the appropriate hostname.rhydonis shown here.
sudo nix run nix-darwin --extra-experimental-features 'nix-command flakes' -- switch --flake ~/.dotfiles/nix#rhydoncdinto$HOME/.dotfilesdirectory
cd ~/.dotfiles- Generate SSH Key (enter through all prompts)
ssh-keygen -t ed25519 -C "[email protected]"- Copy Public SSH Key
cat ~/.ssh/id_ed25519.pub- Add to GitHub
-
Sign in to VSCode to sync settings, and run
Cmd+Shift+P=Install code command in pathto install code -
Copy vscode icons to extensions
cp -r ~/.dotfiles/vscode/icons ~/.vscode/extensions- Due to Affinity Products no longer be listed on the Mac App Store, downlod on Affinity Website
- Sign in to sync settings
Host Short Name: Pokemon
Host Long Name: [LOCATION]-[TYPE]-[ROLE]-[UNIQUE_ID]
LOCATION (Not Applicable to TYPE L)
[COUNTRY_CODE (ISO 3166-1 alpha-2)]-[ADMINISTRATIVE_AREA]-[LOCALITY]-[B-BUILDING_CODE]-[F-FLOOR]-[R-ROOM]
TYPE
- D = Desktop
- L = Laptop
- S = Server
- P = Printer
- W = WiFi Access Point
ROLE
- WS - Workstation
- APP - Application Server
- DB - Database Server
UNIQUE_ID (Numeric)
- Update flake
cd ~/.dotfiles/nix && nix flake update- Rebuild
sudo darwin-rebuild switch --flake ~/.dotfiles/nix#hostname- @use-the-fork - for introducing to me to Nix!
- @NotAShelf/nyx - scalable file structure and code inspiration