Skip to content

davethai/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 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

Installation

  1. Clone dotfiles repo
nix-shell -p git --run 'git clone https://github.com/davethai/dotfiles.git ~/.dotfiles'
  1. Run nix-darwin with flake.nix and replace with the appropriate hostname. rhydon is shown here.
nix run nix-darwin --extra-experimental-features 'nix-command flakes' -- switch --flake ~/.dotfiles/nix#rhydon
  1. cd into $HOME/.dotfiles directory
cd ~/.dotfiles
  1. Install Docker Desktop imperatively

  2. Install Xcode from Mac App Store imperatively

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

  4. Copy vscode icons to extensions

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

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)

Credits