dotfiles
declarative system configurations with NixOS & Flakes
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.