# 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 1. Create `/.nix`: ```nix {config, lib, ...}: with lib; let cfg = config.features..; in { options.features...enable = mkEnableOption "description"; config = mkIf cfg.enable { # Configuration when enabled }; } ``` 2. Import in `/default.nix` 3. Enable in user configs: `features...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, mangohud - `media.nix`: mpv, obs-studio, spotify - `wayland.nix`: Clipboard, screenshots, idle management