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:
- A freshly installed Linux distro (either inside a VM or WSL)
- You can read how to Run Linux VM on macOS
- 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)
- Home Manager installed
- Since our focus is on non-NixOS distros, follow this guide to install Home Manager as a standalone tool using Nix Flakes.
For this note, I will be using Ubuntu 26.04 in a VM via UTM on a MacBook.
Setting Up
- Clone the
nix-dotfilesrepo into your home directory (~):
cd ~
git clone https://github.com/ishahroz/nix-dotfiles- Make sure the dotfiles are located at
~/nix-dotfiles. - Apply the configuration from inside the
nix-dotfilesrepo:
home-manager switch --flake ~/nix-dotfiles- The following becomes your default workflow:
cd ~/nix-dotfiles
home-manager switch --flake .