This repository contains my personal NixOS setup supporting both Hyprland and Niri window managers. The configuration is packaged as a flake so it can be reused on multiple machines with minimal changes.
- Dual window manager support – Choose between Hyprland or Niri (both enabled by default).
- Hyprland desktop with Waybar, Kitty and Rofi enabled by default.
- Niri compositor with scrollable tiling and pre-configured keybindings.
- Dynamic theming generated by Matugen and applied to Kitty, Waybar, Rofi, Hyprland and Dunst.
- Wallpaper daemon
swwwstarted automatically as a user service. - Dotfile modules for Hyprland, Waybar, Kitty, Rofi, Dunst, Niri and Swappy.
- Automatic host discovery – any directory under
hosts/becomes a build target. - Pre‑commit hook checks that every host has a
hardware-configuration.nixfile.
-
Clone the repository
git clone https://github.com/sadjow/nixos-config.git ~/nixos-config cd ~/nixos-config
-
Create a host directory named after your machine and copy the example configuration
mkdir hosts/<hostname> cp hosts/nixos/configuration.nix hosts/<hostname>/
-
Generate and commit the hardware configuration
sudo nixos-generate-config --show-hardware-config > hosts/<hostname>/hardware-configuration.nix git add hosts/<hostname>/hardware-configuration.nix git commit -m "Add hardware configuration"
-
Set your username Edit
flake.nixand change theusernamevariable frommartinto your login name. Update your Git name and email inhome.nix. -
Enable the pre‑commit hook (optional but recommended)
git config core.hooksPath .githooks
-
Build and activate the system
sudo nixos-rebuild switch --flake .#<hostname> -
Choose your window manager Both Hyprland and Niri are enabled by default. At login, select your preferred compositor from the display manager. To disable one:
- Edit
hosts/<hostname>/configuration.nixand setprograms.hyprland.enable = false;orprograms.niri.enable = false; - Edit
home.nixand setmodules.hyprland.enable = false;ormodules.niri.enable = false;
- Edit
-
Install example wallpapers (optional)
./setup-wallpapers.sh
Once logged in you can press Super+W to choose a wallpaper and regenerate the theme.
flake.nix # main flake definition
home.nix # Home‑Manager configuration
hosts/ # one directory per machine
modules/ # optional dotfile modules
scripts/ # helper scripts and git hooks
templates/ # Matugen color templates
The wallpaper selector script in wallpaper-selector lists images from
~/Pictures/Wallpapers and sets the selected file using swww and Matugen.
Most day‑to‑day changes are done through the following files:
home.nix– add extra packages or shell aliases.hosts/<hostname>/configuration.nix– machine specific options.dotfiles/– actual configuration files for Hyprland, Niri, Waybar, Kitty and more.
docs/customization.md– Detailed walkthrough of configuration optionsdocs/window-managers.md– Complete guide to Hyprland vs Niridocs/changes.md– Recent changes and improvements