Setting up a development machine well takes time the first time. Done right, it pays back that investment on every subsequent setup. The goal is a configuration that is version-controlled, reproducible, and fast to apply to a new or rebuilt machine without retracing the same decisions from memory.
This guide covers the full process from OS selection through to automation: choosing between NixOS and Arch Linux, installing core tools, managing dotfiles, configuring the shell and editor, and scripting or flaking the setup so it can be replicated in under an hour.
What this covers:
OS selection: NixOS vs. Arch Linux
Installation quickstart for both
System configuration basics
Package management and essential tools
Dotfiles management with Git and GNU Stow or Nix modules
Shell setup with Zsh and Oh My Zsh
IDEs, editors, and language runtimes
Automating the setup with scripts or Nix Flakes
Backup and cross-machine sync strategies
Step 1: Choose Your OS
The OS shapes every other decision in the setup. For developers who want fine-grained control, NixOS and Arch Linux are the two most capable options in different directions.
NixOS is the better fit if reproducibility is a priority. The entire system is defined in a single configuration file. Rebuilding the same environment on another machine means copying that file and running one command. Atomic rollbacks are built in, which makes it safe to experiment with configuration changes. It works well for teams sharing development environments and for CI/CD pipelines that need consistent build contexts.
Arch Linux is the better fit if direct control and current software matter most. The base install is intentionally minimal, and every component beyond it is a deliberate choice. The rolling release model keeps packages current. The Arch Wiki is one of the best technical references in Linux. It suits developers who want to understand each layer of the system rather than declare it.
Feature | NixOS | Arch Linux |
|---|---|---|
Package manager | Nix | Pacman and AUR |
System configuration | Declarative ( | Manual ( |
Rollback support | Built-in | Requires third-party tooling |
Learning curve | Steep (new paradigm) | Very steep (requires Linux knowledge) |
Step 2: Install the OS
NixOS
Boot from the USB installer
Partition the disk using
cfdiskorpartedFormat and mount the root partition:
sudo mkfs.ext4 /dev/sdaX
sudo mount /dev/sdaX /mntGenerate the initial configuration and edit it:
sudo nixos-generate-config --root /mnt
sudo nano /mnt/etc/nixos/configuration.nix
sudo nixos-installReboot into the new system
The NixOS manual covers hardware-specific edge cases in detail.
Arch Linux
Boot from the USB installer
Connect to the internet via Ethernet or
iwctlfor WiFiPartition and format disks
Mount root and install the base system:
pacstrap /mnt base linux linux-firmwareGenerate fstab and chroot:
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mntConfigure the bootloader, locale, hostname, and user account
The Arch Installation Guide on the wiki is the authoritative reference and is kept current.
Step 3: Configure System Settings
With the OS installed, a short list of base configuration tasks applies to both distributions.
Hostname:
echo "my-dev-machine" > /etc/hostnameTimezone:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtimeLocale: Uncomment the target language in /etc/locale.gen, then run locale-gen.
User account:
useradd -m -G wheel -s /bin/bash yourusername
passwd yourusernameSudo access: Install sudo, add the user to the wheel group, and enable wheel in /etc/sudoers via visudo.
SSH keys: Generate a new key pair or copy existing keys from backup:
ssh-keygen -t ed25519 -C "[email protected]"
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_ed25519Step 4: Install Essential Tools
Install the core tools before configuring anything else. These are the dependencies that everything downstream relies on.
NixOS
Add to environment.systemPackages in configuration.nix:
environment.systemPackages = with pkgs; [
git
zsh
tmux
neovim
curl
wget
openssh
ripgrep
fzf
];Apply:
sudo nixos-rebuild switchArch Linux
sudo pacman -S git zsh tmux neovim curl wget openssh ripgrep fzfFor packages not in the official repositories, install yay or paru to manage AUR packages:
paru -S exa bat fdStep 5: Manage Dotfiles
Dotfiles are the configuration files that define the behavior of every tool in the environment. Version-controlling them means the environment can be reproduced exactly, and changes are tracked over time.
Option 1: Git and GNU Stow
Create a ~/dotfiles directory and organize configuration files by tool. GNU Stow creates symlinks from the dotfiles repository to the expected locations:
cd ~/dotfiles
stow zsh # creates ~/.zshrc symlink
stow tmux # creates ~/.tmux.conf symlink
stow nvim # creates ~/.config/nvim/ symlinksThis is the most portable approach. The same dotfiles repository works on any Linux or macOS machine with Git and Stow installed.
Option 2: NixOS Home Manager
On NixOS, home-manager manages dotfiles declaratively as part of the system configuration:
home.file.".zshrc".source = ./dotfiles/.zshrc;
home.file.".tmux.conf".source = ./dotfiles/.tmux.conf;Apply with sudo nixos-rebuild switch. This integrates dotfile management into the same workflow as package installation and system configuration.
Step 6: Shell Setup
Zsh with Oh My Zsh is covered in detail in the dedicated Zsh setup guide. The short version:
Install and Set Zsh as Default
On Arch:
sudo pacman -S zsh
chsh -s $(which zsh)On NixOS, add zsh to environment.systemPackages and set it in users.users.yourusername.shell = pkgs.zsh.
Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"For faster startup times, Zimfw is a lighter alternative:
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zshConfigure .zshrc
Essential aliases:
alias ll='ls -la'
alias g='git'
alias ..='cd ..'Environment variables:
export EDITOR=nvim
export PATH="$HOME/.local/bin:$PATH"Enable zsh-autosuggestions and zsh-syntax-highlighting for a more productive command line experience. Both require cloning to the Oh My Zsh custom plugins directory before adding them to the plugins list.
Step 7: Editors and Language Runtimes
VS Code
On Arch:
sudo pacman -S codeOn NixOS:
environment.systemPackages = with pkgs; [ vscode ];JetBrains Toolbox
The Toolbox manages JetBrains IDE installations and updates across versions. Install via AUR on Arch or download directly from jetbrains.com/toolbox-app.
Language Runtimes
Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shGo:
sudo pacman -S goPython:
sudo pacman -S python python-pipUse pyenv if multiple Python versions are needed across projects.
Docker:
sudo pacman -S docker
sudo systemctl enable --now docker
sudo usermod -aG docker $USERLog out and back in for the group change to take effect.
Step 8: Automate the Setup
Documenting the setup is the minimum. Automating it means a new machine reaches a working state without manual steps beyond running a single script.
Bash Script for Arch
#!/bin/bash
sudo pacman -Syu --noconfirm git zsh tmux neovim ripgrep fzf
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/yourname/dotfiles.git ~/dotfiles
cd ~/dotfiles && stow zsh tmux nvim
chsh -s $(which zsh)Commit this script to the dotfiles repository so it is available on any new machine after cloning.
Nix Flakes for Reproducible Environments
Nix Flakes pin all dependencies to specific versions, making the environment exactly reproducible:
{
description = "My dev environment";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.buildEnv {
name = "dev-env";
paths = with nixpkgs.legacyPackages.x86_64-linux; [
git
zsh
tmux
neovim
vscode
];
};
};
}Build and activate:
nix build .#default
source result/setup.bashFlakes are particularly useful for CI pipelines and team environments where everyone needs the same tool versions.
Bonus: Backup and Cross-Machine Sync
Backup Strategies
The dotfiles repository covers application configuration. For full system recovery, filesystem snapshots with Btrfs or ZFS provide point-in-time recovery. On systems without those filesystems, timeshift or snapper offer similar functionality.
Syncing Across Machines
For dotfiles that need to work across different operating systems or machine configurations, chezmoi handles templating and conditional logic that GNU Stow does not:
paru -S chezmoi
chezmoi init https://github.com/yourname/dotfiles.git
chezmoi applyNixOS users can manage cross-machine configuration through a shared flake with per-host specialisations, which is the most reproducible approach available.
Key Takeaways
NixOS suits developers who need reproducibility and atomic rollbacks; Arch suits those who want direct control and current software.
Both distros benefit from a version-controlled dotfiles repository applied early in the setup.
GNU Stow is the most portable dotfiles management approach; Nix Home Manager is the most integrated option on NixOS.
Automating the setup with a script or Nix Flake turns a multi-hour manual process into a single command on subsequent machines.
Backing up dotfiles to a Git repository and taking filesystem snapshots covers both configuration recovery and full system recovery.
Conclusion
A development environment set up with version control, automation, and portability in mind is an investment that pays back on every machine migration, rebuild, or team onboarding. The first setup takes longer. Every subsequent one is faster and more reliable than starting from memory.
The practices here, particularly dotfiles management and setup automation, apply regardless of OS choice. They scale from a solo developer to a team where consistent environments matter for build reproducibility.
Have a specific tool or automation trick that has made your setup more reproducible? Share it in the comments.




