To get started with NixOS, follow these steps:
- Installation: Install NixOS on your machine by following the official installation guide.
- Enable Nix-Command and Flakes options: Edit your configuration.nix file located at /etc/nixos/configuration.nix
adding this line ->
nix.settings.experimental-features = [ "nix-command" "flakes" ];
- Rebuild your system (without the flake):
Open a terminal and run ->
sudo nixos-rebuild switch
- Clone this repo:
rename .git to anything else before introducing new changes.
git clone https://github.com/etherbiswas/NixOS ~/dotfiles
- Edit username: By default, the username for all the configuration is
ether
and the hostname isareo13
. You can change this as you want by editing in all the files (don't forget to rename the folder inside hosts).grep -i -R ether ~/.config/nixos/
andgrep -i -R areo13 ~/.config/nixos/
are useful. - Copy your specific hardware-configuration.nix file: You need to copy your hardware-configuration.nix file located at /etc/nixos/hardware-configuration.nix to the hosts folder. Always do this on new installs even if same hardware to avoid boot issues.
- Review default.nix file inside hosts folder. It contains the configuration for amd and intel. Choose accordingly to your hardware.
- Apply the flake: Open a terminal and inside
~/.config/nixos/
run
sudo nixos-rebuild switch --flake .#<hostname>
- Fingers crossed Reboot!