- Acquire a NixOS 24.05+ image:
wget -O nixos.iso https://channels.nixos.org/nixos-unstable/latest-nixos-minimal-x86_64-linux.iso
- Write it to a USB drive:
# Replace /dev/sdX with the correct partition!
cp nixos.iso /dev/sdX
- Restart and boot into the installer.
- Do your partitions and mount your root to
/mnt
- Clone these dotfiles somewhere:
git clone --recurse-submodules https://github.com/lejeunel/dotfiles
- Create a host config in
hosts/
- Run the installer:
sudo nixos-install \
--impure \
--show-trace \
--root /mnt \
--flake .#host
Where host corresponds to a host defined in hosts/
- Copy dotfiles over to new partition
sudo mkdir -p /mnt/etc/nixos
sudo cp -R $PWD /mnt/etc/nixos/dotfiles
- Then reboot and you’re good to go!
[!WARNING]
Don’t forget to change your root
and $USER
passwords! They are set to
nixos
by default.
nh os switch -u ~/dotfiles
See Makefile.
nh clean all
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf