My Nix/NixOS configuration files.
Clone repository and submodules:
git clone --recursive https://github.com/mech-pig/nix-config.git
Remove any existing /etc/nixos/configuration.nix
file and link the new configuration with:
sudo sh link.sh
Finally, activate the configuration:
sudo nixos-rebuild switch
- Replace
nixos
channel alias to make it point to the correct versionsudo nix-channel --add https://nixos.org/channels/nixos-XX.YY nixos
- Do the same for the
home-manager
channel:sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-XX.YY.tar.gz home-manager
(ensure the version ofhome-manager
matches thenixos
one) - Update the channels:
sudo nix-channel --update
- Build the system and reboot:
sudo nixos-rebuild --upgrade boot
This happened to me after I replaced an ssd with a new one. This operation has somehow corrupted the partition mapping and I was not able to boot neither into nixos nor into windows. I solved the problem by fixing the Windows EFI entry in the bootloader (references to disk partitions were wrong) followed by a rebuild of the nixos systemd-boot entries (this procedure is provided by nixos itself).
- Repair UEFI bootloader in Windows - I just fixed the boot manager and bootloader using
bcedit
from a recovery usb drive, no need to re-create the EFI partition as it was already there, cloned from the previous ssd - Re-installing the nixos bootloader - I used the minimal nixos installer to mount my existing
nixos
andboot
partitions and just followed the procedure to re-install the bootloader.
- NixOS/Win dual boot guide: I followed this guide to install NixOS alongside an existing Windows 10 installation.
- NixOS manual
- home-manager manual
- Nix User Repository: a community-driven meta repository for Nix packages.