NixOS and Dotfiles Installation Guide

Step 0: Base NixOS Installation

To begin, install a minimal NixOS setup by following the official guide below: 📚 NixOS Installation Guide

Once you're done and have rebooted into your system, proceed with the steps below.


Step 1: Clone the Repository

Clone to your home directory (the flake expects to live in ~/dotfiles for certain absolute path references):

git clone https://codeberg.org/Gurjaka/Dotfiles.git ~/dotfiles
cd ~/dotfiles

Step 2: Defining a Host

In the dendritic pattern, every host is a self-contained module under modules/hosts/<hostname>/.

  1. Host Directory: Create a new directory modules/hosts/<hostname>/.
  2. Hardware: Copy your hardware-configuration.nix into that folder.
  3. Module Definition: Create a default.nix in that folder. It should define nixosConfigurations and homeConfigurations for that host, importing modules from self.nixosModules and self.homeModules.
  4. Registration: Thanks to import-tree, you don't need to manually register the host in the root flake.nix. Just adding the file to the tree is enough!

Step 3: Defining a User

User configurations are also handled within the host's default.nix via homeConfigurations.

  1. User Details: Specify userEmail, userGit, and other preferences in the hostSpec let-block within your host's default.nix.
  2. Toggle Features: Enable or disable specific modules (e.g., bash, nvim, qtile) by adding them to the modules list in homeConfigurations.

Step 4: Apply Configuration

Note: Nix Flakes only see files tracked by Git. If you added a new directory under modules/, run git add . first.

# Apply System (NixOS)
sudo nixos-rebuild switch --flake .#big-hat

# Apply User (Home Manager)
nix run home-manager -- switch --flake .#big-hat

Note: The user configuration is often named the same as the host in this setup (e.g., .#big-hat). Check your homeConfigurations key in default.nix.

Step 5: Vivaldi Note (If Used)

If your preferred browser is Vivaldi, make sure to launch it once manually to generate its configuration directories.

Then, re-run the home-manager switch:

nix run home-manager -- switch --flake ~/dotfiles#HOSTNAME

This will allow Vivaldi's preconfigured settings to be applied cleanly.


Step 5: Secrets with agenix

If you are using secrets (like API tokens, SSH keys, etc.), your dotfiles may include a secrets/ directory managed via agenix.


Step 6: Confirm Everything Works

After setup, verify the following:

  • Theme applied (defaulting to Nord, managed by Juna)
  • Qtile working with custom bar + widgets
  • Terminal (Foot) themed and functional
  • Fish or Zsh shell initialized properly
  • Notification daemon (SwayNC) running on Wayland
  • Neovim opens with correct LSPs and theme
  • Scripts and aliases available in terminal (showalias to see them)

If any issues arise, attempt to rebuild the configuration. For missing permissions, verify user settings in secrets or flake.nix.