2.1 KiB
2.1 KiB
features/ - Modular Home Manager Features
Toggle-able feature modules using mkEnableOption pattern.
Structure
features/
├── cli/ # Shell & terminal tools
│ ├── default.nix # Always-on CLI tools (bat, eza, direnv, carapace)
│ ├── nushell.nix # features.cli.nushell.enable
│ ├── fzf.nix # features.cli.fzf.enable
│ ├── starship.nix # features.cli.starship.enable
│ ├── zellij.nix # Always-on zellij config
│ └── secrets.nix # features.cli.secrets.enable
├── coding/ # Dev tools
│ └── default.nix # features.coding.* (zed, neovim)
└── desktop/ # GUI applications
├── default.nix # Always-on (kitty, xdg, cursor)
├── hyprland.nix # features.desktop.hyprland.enable
├── gaming.nix # features.desktop.gaming.enable
├── media.nix # features.desktop.media.enable
└── ...
Creating a New Feature
- Create
<category>/<feature>.nix:
{config, lib, ...}:
with lib; let
cfg = config.features.<category>.<feature>;
in {
options.features.<category>.<feature>.enable =
mkEnableOption "description";
config = mkIf cfg.enable {
# Configuration when enabled
};
}
- Import in
<category>/default.nix - Enable in user configs:
features.<category>.<feature>.enable = true;
Feature Categories
| Category | Purpose | Key features |
|---|---|---|
| cli | Shell tools | nushell, fzf, starship, nitch, secrets |
| coding | Development | (in default.nix, no sub-features yet) |
| desktop | GUI/WM | hyprland, gaming, media, office, crypto, fonts, rofi, wayland |
Always-On vs Toggle-able
- default.nix: Configuration that applies when the category is imported (no enable flag)
- .nix: Must be explicitly enabled via
features.*.enable = true
Desktop Feature Details
hyprland.nix: Window manager config, keybinds, window rules (host overrides monitors/workspaces)gaming.nix: Steam, gamemode, mangohudmedia.nix: mpv, obs-studio, spotifywayland.nix: Clipboard, screenshots, idle management