Skip to content

Installation

  1. Download NixOS and flash it to the installation media e.g. a USB drive I recommend using Ventoy for making a bootable USB drive
  2. Boot into the installation media and open the browser to this site to run the commands below after opening the terminal
  3. Run the following commands after carefully reading the instructions given before each of them
    Terminal window
    # Fetch NixDots and `cd` into it
    nix-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 want
    nano ./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`
    lsblk
    sudo 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 things
    sudo 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-enter
    passwd <your_username>
    # Installation complete! Power off and remove the installation media
    systemctl poweroff
  1. Just run the following commands in the terminal carefully
    Terminal window
    # Fetch NixDots and `cd` into it
    nix-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 want
    nano ./flake.nix
    # !!IMPORTANT!!
    # Skipping this step will cause data loss among other not very nice things
    sudo 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 update
    sudo nixos-rebuild boot --flake <path to NixDots>/#<hostname>
    # Reboot your system
    systemctl reboot