NixOS Dotfiles | System Configuration
technologies: Nix, NixOS Flakes, Home-Manager, Hyprland, Systemd


philosophy

Traditional dotfiles management relies on symlinks, manually run install scripts, and ad-hoc package installations. If your system breaks or you switch hardware, recreating that exact environment is a headache.

This repository houses my entire OS and application setup as a declarative, version-controlled Nix Flake codebase. A single terminal command rebuilds the entire operating system, downloads packages, configures files, and registers system settings:

sudo nixos-rebuild switch --flake .#HOSTNAME

structure

The codebase is split into modular directories handling system-wide NixOS configurations, home-manager user spaces, and hardware specifications:

.dotfiles/
β”œβ”€β”€ flake.nix               # entrypoint defining system settings and color schemes
β”œβ”€β”€ configuration.nix       # main system settings
β”œβ”€β”€ hosts/                  # hardware profiles
β”‚   β”œβ”€β”€ conceivably-a-shark/ # hybrid graphics laptop configuration (intel + nvidia)
β”‚   └── plausibly-a-shark/   # desktop configuration (pure nvidia GPU)
β”œβ”€β”€ modules/                # reusable system modules
└── home/                   # user space managed by home-manager
    β”œβ”€β”€ hyprland/           # window manager bindings, layouts and variables
    β”œβ”€β”€ waybar/             # custom status bar configurations
    └── home.nix            # default user configuration (shells, git, themes)

highlights

1. prime configuration

For the laptop host (conceivably-a-shark), we handle high-performance Nvidia GPU synchronization and power management by configuring specific PCI Bus IDs mapping the hardware controllers:

# excerpt from configuration.nix
hardware.nvidia.prime = {
  nvidiaBusId = "PCI:1:0:0";
  intelBusId = "PCI:0:2:0";
};

2. centralized themes

The entire system’s styling (window borders, terminal backgrounds, waybar alerts, and text highlights) inherits its colors from a single, centralized theme variable declared inside flake.nix. It sets hex and RGB values for the standard base16 spectrum:

# flake.nix
theme = {
  base00 = "0e0e0e";     # primary dark background
  base01 = "161616";     # secondary background
  base0B = "8f63ee";     # primary purple accent
  base09 = "ff8b39";     # secondary orange accent
};

These colors are mapped dynamically into configuration templates during home-manager evaluation, keeping my desktop style clean and cohesive.