Here are my cross-platform dotfiles using NixOS, home-manager, and nix-darwin.
MacOS | NixOS | |
---|---|---|
Shell: | zsh + starship | " |
WM: | Aqua + Rectangle | Niri + Waybar |
Editor: | Neovim + Doom Emacs | " |
Terminal: | ghostty | " |
Launcher: | raycast | rofi |
Browser: | firefox | " |
I pulled out every possible stop on this config. I have
- encrypted /root partition
- declarative disk partitioning with disko
- impermanence using btrfs subvolumes and impermanence to persist a few select folders
- home-manager to manage dotfiles
- systemd-initrd purely for the plymouth luks prompt
These steps should not be blindly followed, they're for my own personal reference.
- Acquire a NixOS 24.05+ image:
wget -O https://channels.nixos.org/nixos-24.11/latest-nixos-minimal-x86_64-linux.iso
- Write it to a USB drive. I prefer Ventoy.
- Restart and boot into the installer.
- Clone these dotfiles somewhere and
cd
into them.
git clone https://github.com/x0ba/dotfiles.git
- Set your desired encryption password.
echo -n "password" > /tmp/secret.key
- Partition your disks using disko. Make sure to replace the device arg with the hard disk you want to install NixOS on.
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --arg device '"/dev/nvme0n1"' --mode destroy,format,mount ./disks/default.nix
- Create a host config in
systems
. See existing ones for examples. - Install NixOS
sudo nixos-install --root /mnt --flake .#host
- Reboot and you're good to go!
- [OPTIONAL] Set up an SSH key to decrypt sops secrets. Currently it's only being used to declaratively set my user password and for tailscale.
- Install the XCode command line tools
sudo xcode-select --install
- Install Homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Nix using the Determinate installer.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install
- Install the flake
nix run nix-darwin -- switch --flake .#exo