Thanks to visit codestin.com
Credit goes to github.com

Skip to content

davethai/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My dotfiles

Windows (WSL 2) - NixOS

Requirements

  1. WSL 2 NixOS is enabled

Installing WSL 2 (NixOS)

  1. Ensure WSL is enabled.
wsl --install --no-distribution
  1. Download nixos-wsl.tar.gz from the latest release

  2. Import the tarball into WSL 2

wsl --import NixOS $env:USERPROFILE\NixOS\ nixos-wsl.tar.gz --version 2
  1. Set NixOS as the default distro (optional - but recommended)
wsl --set-default NixOS
  1. You can now run NixOS (-d NixOS is not required because NixOS is default distro)
wsl

Installation

  1. Clone the repo
nix-shell -p git --run 'git clone https://github.com/davethai/dotfiles.git ~/.dotfiles'
  1. Apply the appropriate NixOS hostname configuration (ex: dewgong is shown here) and shutdown the WSL 2 Virtual Machine (VM)
nix-shell -p git --run 'sudo nixos-rebuild switch --flake ~/.dotfiles/nix#dewgong'
  1. Reconnect to WSL 2 VM
wsl

Darwin (MacOS) - Nix

Requirements

  1. Nix package manager is installed
  2. Command Line Tools for Xcode

Install Nix

  1. Run the command below
sh <(curl -L https://nixos.org/nix/install)

Install Xcode Command Line Tools (Installs git)

  1. Run the command below
xcode-select --install

Git Config

  1. Set git name and email
git config --global user.name "Dave Thai"
git config --global user.email "[email protected]"

Installation

  1. Clone dotfiles repo
nix-shell -p git --run 'git clone https://github.com/davethai/dotfiles.git ~/.dotfiles'
  1. Install Xcode from Mac App Store imperatively

  2. Agree to Xcode License

sudo xcodebuild -license accept
  1. Run nix-darwin with flake.nix and replace with the appropriate hostname. rhydon is shown here.
sudo nix run nix-darwin --extra-experimental-features 'nix-command flakes' -- switch --flake ~/.dotfiles/nix#rhydon
  1. cd into $HOME/.dotfiles directory
cd ~/.dotfiles

GitHub SSH Keys

  1. Generate SSH Key (enter through all prompts)
ssh-keygen -t ed25519 -C "[email protected]"
  1. Copy Public SSH Key
cat ~/.ssh/id_ed25519.pub
  1. Add to GitHub

Application Setup

VSCode

  1. Sign in to VSCode to sync settings, and run Cmd + Shift + P = Install code command in path to install code

  2. Copy vscode icons to extensions

cp -r ~/.dotfiles/vscode/icons ~/.vscode/extensions

Affinity Suite (Photo, Designer, Publisher)

  1. Due to Affinity Products no longer be listed on the Mac App Store, downlod on Affinity Website

Google Chrome

  1. Sign in to sync settings

Host Naming Convention

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)

Maintenance

  1. Update flake
cd ~/.dotfiles/nix && nix flake update
  1. Rebuild
sudo darwin-rebuild switch --flake ~/.dotfiles/nix#hostname

Credits

Releases

No releases published

Packages

No packages published