Installation
Fresh Install
Section titled “Fresh Install”- Download NixOS and flash it to the installation media e.g. a USB drive I recommend using Ventoy for making a bootable USB drive
- Boot into the installation media and open the browser to this site to run the commands below after opening the terminal
- Run the following commands after carefully reading the instructions given before each of them
Terminal window # Fetch NixDots and `cd` into itnix-shell -p git --run "git clone https://github.com/Voxi0/NixDots.git"cd NixDots# Configure some stuff e.g. username and keyboard layout# Nano is installed by default, use another editor if you wantnano ./flake.nix# List all mounted disks to choose a disk to install NixOS on# Replace `<disk label/name>` with the name of the disk you wish to install NixOS on e.g. `/dev/sda`lsblksudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- -m disko --argstr device "<disk label/name>" ./disko.nix# !!IMPORTANT!!# Skipping this step will cause data loss among other not very nice thingssudo nixos-generate-config --show-hardware-config --root /mnt > hosts/<hostname>/hardware-configuration.nix# Install NixOS# Press `y` to say "yes" to all questions e.g. binary caches and such - Without them installation will take hours# sudo nix flake update --experimental-features 'nix-command flakes'sudo nixos-install --flake ./#<hostname># Chroot into the new system to run additional commands like changing your password# Default password for any user is `nixos`sudo nixos-enterpasswd <your_username># Installation complete! Power off and remove the installation mediasystemctl poweroff
On An Existing NixOS Installation
Section titled “On An Existing NixOS Installation”- Just run the following commands in the terminal carefully
Terminal window # Fetch NixDots and `cd` into itnix-shell -p git --run "git clone https://github.com/Voxi0/NixDots.git"cd NixDots# Configure some stuff like username and keyboard layout# Nano is installed by default, use another editor if you wantnano ./flake.nix# !!IMPORTANT!!# Skipping this step will cause data loss among other not very nice thingssudo nixos-generate-config --show-hardware-config > hosts/<hostname>/hardware-configuration.nix# Rebuild the system - Update the flake if you desire but it may or may not break stuff# sudo nix flake updatesudo nixos-rebuild boot --flake <path to NixDots>/#<hostname># Reboot your systemsystemctl reboot