Shared NixOS Configuration
Code in this directory is used by all hosts across both nixpkgs channels
(unstable and stable/25.11). See ../AGENTS.md for the full channel map.
Rules for Modifying Shared Code
-
Never assume an option exists on all channels. Options added or renamed in nixpkgs-unstable won’t exist on nixpkgs-25.11 (and vice versa for backports). When in doubt, check the option exists before using it.
-
Use conditional patterns when a change is channel-dependent:
# Check if an option exists before using it lib.optionalAttrs (builtins.hasAttr "newOption" options.services.foo) { services.foo.newOption = true; } # Version-gated setting lib.mkIf (lib.versionAtLeast config.system.nixos.release "25.11") { services.foo.bar = "new-value"; } -
Prefer host-specific overrides over conditionals when the change only affects one or two hosts. Edit
systems/<hostname>/extra.nixinstead of modifying shared modules. -
Test both channels after modifying shared code:
- Unstable:
make host/okinawa/build - Stable:
make host/rhea/build
- Unstable:
Directory Structure
base/— core system settings (nix, boot, locale, networking, security)desktop/— desktop environment modules (sway, niri, waybar, etc.)hardware/— hardware support (audio, bluetooth, GPU, etc.)programs/— system-wide program configurationsservices/— system service configurationsusers/— user account definitions