NixDots

This is my personal NixOS configuration/dotfiles using Flakes and Home Manager. I'm also making use of Disko to declaratively partition and format disks using Nix. Feel free to use my configuration as you wish and star the repo to show support. Any contributions would be greatly appreciated!

Why NixOS?

Here's a couple of reasons why I considered using NixOS and eventually moved to it from Arch Linux. There are many more benefits of using NixOS but these are the most common.

  • Does not break / Easy to recover - Rebuilding NixOS creates a new generation while preserving the previous generation. This allows the user to easily rollback to the previous generation if things go awry by choosing it in the boot menu.

  • Reproducibility: It's very easy to have identical systems. All you do is fetch someone's NixOS configuration and rebuild your system using it.

  • Huge Package Repository: Nixpkgs has over 100,000 software packages that you can install with the Nix package manager. It's the largest software repository in existence as of now, even larger than the mighty AUR

Info

Showcase

Desktop Neovim

Contributors

Made with contrib.rocks.

Installation

  • Prepare a NixOS installation media and boot into it.
  • Open the terminal and run the following commands. Read thoroughly before running each command.
# Fetch NixDots and `cd` into it
nix-shell -p git --run "git clone https://github.com/Voxi0/NixDots.git"
cd NixDots

# Set your username (Set to my personal username by default `voxi0`) and the disk where NixOS is installed (REQUIRED)
nano ./flake.nix    # Nano is installed by default, use another editor if you want

# List all mounted disks to choose a disk to install NixOS on
lsblk

# Run the install script
# Replace `<install_disk>` with the name of the disk to install NixOS to e.g. `/dev/sda`
# Replace `<hostname>` with the NixDots host to install/build e.g. `neo`
./install.sh <install_disk> <hostname>

# Chroot into the new system to run additional commands like changing your password
sudo nixos-enter
passwd root             # Change the root password from `nixos` to something else if you want
passwd <your_username>  # Definitely change your password from `nixos` to something else

# Installation is complete! Power off and remove the installation media
poweroff

Post-Installation

  • Update the system: The Nix Helper CLI is installed so you might wanna use that instead of nixos-rebuild as it just looks nicer and is more informative. It's a really nice tool in general. cd into NixDots and run nh os boot -H <hostname> ./flake.nix --update to update the system and add it to the boot menu, then reboot your system to select the latest generation. Look into nh os clean to clean up garbage. I'm sure you can figure out how to use nh yourself.

  • Move NixDots somewhere else: Don't keep NixDots /etc/nixos, move it somewhere in your home directory so you can modify it freely. Just moving NixDots isn't enough so run this command to change the ownership of NixDots so you can modify it without superuser, sudo chown -R <your_username> <nixdots_new_location>.

  • Gaming: Run protonup to install the latest version of Proton GE which can then be selected in Steam, allowing you to play just about every game on Steam on NixOS, or Linux in general. Without Proton, you will be unable to run most Steam games unless they're natively supported which is a select few.