Repository structure
Module organization
NixOS modules (modules/nixos/)
System-level modules that configure services, packages, and system settings. All custom options are defined in modules/nixos/options.nix — this is the single source of truth for the marchyo.* namespace.
Key files:
options.nix— Allmarchyo.*option definitionsdefault.nix— Import list for all NixOS modules (order matters for some)desktop-config.nix— Feature flag cascading (desktop enables media, office, etc.)defaults.nix— Default application managementkeyboard.nix— Layout normalization and XKB configurationfcitx5.nix— Input method engine configurationinput-migration.nix— Assertions for removedmarchyo.inputMethod.*options
Home Manager modules (modules/home/)
User-level modules that configure dotfiles, user applications, and Hyprland settings. These modules access NixOS config via osConfig:
Generic modules (modules/generic/)
Shared modules imported by both NixOS and Home Manager default.nix files. These contain configuration that applies at both levels (e.g., fontconfig, git).
Module patterns
Standard NixOS module
Key Nix functions
| Function | Purpose |
|---|---|
lib.mkIf condition { ... } | Conditionally include a config block |
lib.mkDefault value | Set a value at lower priority (consumers can override) |
lib.mkMerge [ ... ] | Combine multiple conditional blocks safely |
Feature flag cascading
Whenmarchyo.desktop.enable = true, the desktop-config module auto-enables related flags using lib.mkDefault so consumers can override:
Cross-module data flow
The keyboard/IME system is the most complex cross-module pattern:options.nix— Definesmarchyo.keyboard.layoutsaccepting strings or attrsetskeyboard.nix— Normalizes layouts (string"us"→{ layout = "us"; variant = ""; ime = null; }) and sets XKB configfcitx5.nix— Reads normalized layouts, detects IME addons needed, generates fcitx5 configmodules/home/keyboard.nix— Extracts layout data intohome.keyboardfor Hyprlandmodules/home/hyprland.nix— ReadsosConfig.marchyo.graphicsfor GPU env vars and keyboard fromhome.keyboard
Flake inputs
| Input | Purpose |
|---|---|
nixpkgs | NixOS unstable channel |
nixos-hardware | Hardware-specific modules |
home-manager | User environment management |
stylix | System-wide theming |
treefmt-nix | Multi-tool code formatter |
vicinae | Application launcher |
noctalia | Shell configuration |
worktrunk | Additional tooling |