I Use Nix❄️ BTW
Background
Tired of battling inconsistent setups across my three machines (each with a different OS and hardware), I embarked on a mission. It wasn’t just about syncing dotfiles; I needed every program I rely on to be identically available, everywhere. Enter Nix.
Now, before you jump to conclusions, let me be clear: I wasn’t looking to switch my operating system entirely. NixOS is amazing, but I’m still firmly committed to using Arch Linux on my primary machines. My goal was to leverage Nix as a powerful package manager and configuration tool on top of my existing Arch installations, not replace them.
Instalation
My Nix journey began with installation, which thankfully was straightforward. I opted for the Determinate Systems Nix Installer – a quick and reliable way to get Nix up and running.
Home Manager
After successfully installing Nix, the next crucial step in unifying my setup was integrating Home Manager. This powerful Nix-powered tool allows you to declaratively manage your user environment — from dotfiles to installed programs, environment variables, and even systemd user units. It brings Nix’s full reproducibility to your personal user space, ensuring identical configurations across machines, regardless of the underlying OS.
Since I’m sticking with Arch Linux and not using NixOS, a standalone installation of Home Manager is recommended. However, there was a specific “catch”: the Determinate Nix installer, which I used, heavily favors Nix flakes and deprecates the use of Nix channels. To align with this, I carefully followed the “Standalone setup” using flakes here. This ensured my Home Manager setup was modern, reproducible, and fully integrated with the flake-centric approach. As stated in documentation i run this to generate the initial flakes config.
$ nix run home-manager/master -- init
This will generate a flake.nix
and a home.nix
file in ~/.config/home-manager
. After I’ve made changes to home.nix
, i just need to run switch and all of my configuration will be applied.
$ nix run home-manager/master -- switch
To explore the vast array of possibilities within Home Manager, I found the official manual’s options page invaluable: home-manager.dev/manual/25.05/options.xhtml. For a more user-friendly search experience, home-manager-options.extranix.com also proved to be an excellent resource.
Closing
While I haven’t delved into the specifics of adding new Home Manager configurations, I’m confident that Nix will significantly simplify syncing my setup across all my devices. Despite the undeniable power and elegance of Nix, the biggest hurdle I’ve encountered on this journey is the lack of truly comprehensive and unified documentation, often requiring me to piece together information from various sources.