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>/.
- Host Directory: Create a new directory
modules/hosts/<hostname>/. - Hardware: Copy your
hardware-configuration.nixinto that folder. - Module Definition: Create a
default.nixin that folder. It should definenixosConfigurationsandhomeConfigurationsfor that host, importing modules fromself.nixosModulesandself.homeModules.- Refer to
modules/hosts/big-hat/default.nixfor a complete example.
- Refer to
- Registration: Thanks to
import-tree, you don't need to manually register the host in the rootflake.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.
- User Details: Specify
userEmail,userGit, and other preferences in thehostSpeclet-block within your host'sdefault.nix. - Toggle Features: Enable or disable specific modules (e.g.,
bash,nvim,qtile) by adding them to themoduleslist inhomeConfigurations.
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 yourhomeConfigurationskey indefault.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 (
showaliasto see them)
If any issues arise, attempt to rebuild the configuration. For missing permissions, verify user settings in secrets or flake.nix.