In this note, we will discuss how to quickly spin up Linux VMs or WSL distros and install/set up essential tools from scratch using dotfiles (powered by Nix + Home Manager).

Prerequisites

Before proceeding, make sure you have:

  1. A freshly installed Linux distro (either inside a VM or WSL)
  2. Nix installed
    • You can read how to set up Nix on WSL
    • OR how to set up Nix on Linux (if you’re running Linux as your OS or in a VM)
  3. Home Manager installed

For this note, I will be using Ubuntu 26.04 in a VM via UTM on a MacBook.

Setting Up

  1. Clone the nix-dotfiles repo into your home directory (~):
cd ~
git clone https://github.com/ishahroz/nix-dotfiles
  1. Make sure the dotfiles are located at ~/nix-dotfiles.
  2. Apply the configuration from inside the nix-dotfiles repo:
home-manager switch --flake ~/nix-dotfiles
  1. The following becomes your default workflow:
cd ~/nix-dotfiles
home-manager switch --flake .