diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c9536f2..d7c0fbf 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,58 +1,48 @@ # Copilot Instructions for EmergentMind's Nix-Config ## Project Overview -- This is a modular, flake-based NixOS configuration system, designed for multi-host, multi-user, and reproducible setups. -- **Major directories and their roles:** - - `hosts/`: Per-host NixOS configs (e.g., `hosts/nixos/Bellerophon/`). Each host has its own directory with a `default.nix` entrypoint, plus hardware, disk, and optional feature overrides. - - `home/`: Per-user Home Manager configs. User-specific and shared configs, with `common/` for reusable modules and `optional/` for opt-in features. - - `modules/`: Reusable NixOS and Home Manager modules, auto-imported via `lib.custom.scanPaths`. This is where most custom logic, options, and abstractions live—including CLI tool modules, system services, and shared config patterns. - - `overlays/`, `pkgs/`: Custom packages and overlays. CLI tools that are not in upstream Nixpkgs are typically defined here (see `pkgs/common/` for examples like `cd-gitroot`). - - `nixos-installer/`: Standalone flake for bootstrapping new hosts, with its own README and workflows. - - `docs/`: Project documentation, including secrets management and architecture guides. - - `scripts/`: Helper scripts for bootstrap, rebuild, sops, etc. Used in developer workflows and automation. - - `tests/`: Automated tests (Bats), with fixtures and helpers for validating secrets, modules, and workflows. -- **Desktop Environments & Optional Features:** - - Desktop environments (GNOME, KDE, XFCE, etc.) and other optional system features are modularized under `hosts/common/core/optional/` and its subfolders (e.g., `gnome.nix`, `kde.nix`, `xfce.nix`). - - These are imported by hosts as needed, allowing flexible, DRY configuration. -- **CLI Tools:** - - System-wide CLI tools are typically declared in `modules/` (as NixOS or Home Manager modules), or in `pkgs/` if packaged locally. - - User-level CLI tools are managed via Home Manager modules in `home//common/core/shell/` (e.g., `fish.nix`, `bat.nix`, `eza.nix`). - - Many tools are grouped by function (shell, coding, productivity, etc.) for clarity and reusability. -- **Disk Layout:** Disk setup is handled by `disko` modules, with per-host overrides for device and swap in `hosts/common/core/disks/`. -- **Secrets:** Secrets are managed via a private `nix-secrets` repo and sops-nix. See `docs/secretsmgmt.md` and `nixos-installer/README.md` for details. -- **VSCode/Language Support:** Language-specific VSCode configs live in `home/panotaka/common/optional/coding/vscode/languages/` and are imported via the main VSCode module. +- This is a modular, flake-based NixOS configuration system for managing multiple hosts, users, and environments (NixOS, Darwin, Home Manager). +- The repo is structured for maximum composability: core logic is split into `hosts/`, `home/`, `modules/`, and `overlays/` with heavy use of imports and attribute sets. +- Secrets are managed via a private `nix-secrets` repo and sops-nix, integrated as a flake input (see docs/secretsmgmt.md). -## Key Patterns & Conventions -- **Imports:** Use `lib.custom.relativeToRoot` and `lib.custom.scanPaths` for DRY, recursive module imports. -- **Host/Module Structure:** Each host and user has a directory with a `default.nix` as entrypoint. Common/optional configs are split for clarity. -- **Disk Layout:** Disk setup is handled by `disko` modules, with per-host overrides for device and swap. -- **Secrets:** Secrets are managed via a private `nix-secrets` repo and sops-nix. See `docs/secretsmgmt.md` and `nixos-installer/README.md` for details. -- **VSCode/Language Support:** Language-specific VSCode configs live in `home/panotaka/common/optional/coding/vscode/languages/` and are imported via the main VSCode module. +## Key Architectural Patterns +- **Host configs**: Each host (machine) has its own directory under `hosts/nixos/` or `hosts/darwin/`, with a `default.nix` that imports shared and host-specific modules. +- **User configs**: User-level Home Manager configs live in `home//.nix` and are imported by host configs. +- **Common logic**: Shared modules for users and hosts are in `hosts/common/` and `home/exampleSecondUser/common/` etc. +- **Optional features**: Features like desktops, shells, and services are split into `common/optional/` submodules and imported as needed. +- **Installer**: The `nixos-installer/` flake provides a minimal environment and scripts for bootstrapping new machines. ## Developer Workflows -- **Build & Rebuild:** Use `just rebuild` (runs pre/post hooks, see `justfile`). For full checks: `just rebuild-full` or `just check`. -- **ISO Generation:** `just iso` builds a custom NixOS installer ISO. -- **Secrets:** Use `just rekey`, `just sops-add-creation-rules`, and related commands for sops/age key management. -- **Sync/Deploy:** Use `just sync` and `just build-host` for remote deployment. -- **Testing:** Tests live in `tests/` and use `bats`. +- **Build & switch**: Use `just` commands (see `justfile`) for common workflows, e.g. `just switch`, `just iso`, or run `nixos-rebuild switch --flake .#`. +- **Testing**: Tests are in `tests/` and use `bats` for shell scripts. Run with `just test`. +- **Secrets**: To update secrets, edit the `nix-secrets` repo and re-pull as a flake input. +- **Installer**: See `nixos-installer/README.md` for remote install and ISO generation. + +## Project-Specific Conventions +- **Imports**: Always use relative imports and `lib.flatten` for lists of modules. +- **pkgs**: Always passed as an argument; use `with pkgs; [...]` for package lists. +- **Shells**: Shell configs (fish, zsh, nushell) are in `home/panotaka/common/core/shell/` and imported as needed. +- **Hyprland**: Desktop config is modularized; plugins and settings are split into separate files (see `home/panotaka/common/optional/desktops/hyprland/`). +- **Keybinds**: For Hyprland, keybinds can be set in feature modules (e.g. hyprlock) using `wayland.windowManager.hyprland.keybinds`. +- **Packages**: Each feature module (e.g. hyprlock, hypridle) is responsible for adding its own package to `home.packages`. ## Integration Points -- **External:** Relies on `nix-secrets` (private), sops-nix, disko, stylix, nix4vscode, and nixos-hardware modules. -- **Cross-Component:** Host configs import common modules and optional features via mapped imports. Home Manager and NixOS modules are kept separate but coordinated. +- **Secrets**: sops-nix, private flake input, see `docs/secretsmgmt.md`. +- **Disk layout**: Uses disko for declarative disk partitioning, see `hosts/common/disks/`. +- **Theming**: Stylix is used for theming, imported as a flake input. +- **Remote install**: `nixos-installer/` flake and scripts for remote/automated setup. ## Examples -- To add a new host: copy an existing host dir in `hosts/nixos/`, update disk and user settings, and add secrets as per `nixos-installer/README.md`. -- To add a new language to VSCode: add a `.nix` file to `vscode/languages/` and import it in the main VSCode module. -- To add a new CLI tool: create a module in `modules/` or a package in `pkgs/`, then import it in the relevant host or user config. -- To enable a desktop environment: import the relevant module from `hosts/common/core/optional/` in your host's `default.nix`. -- To update secrets: run `just rekey` and follow the documented workflow. +- To add a new desktop feature, create a module in `common/optional/desktops/` and import it in the host or user config. +- To add a new shell, create a module in `common/core/shell/` and import it in the user config. +- To add a new host, create a directory in `hosts/nixos/` and a matching user config in `home//`. -## References -- See `README.md`, `nixos-installer/README.md`, and `docs/secretsmgmt.md` for deep dives on architecture and workflows. -- For module patterns, see `modules/` and `hosts/common/core/`. -- For CLI tool packaging, see `pkgs/` and `modules/`. -- For desktop environment modules, see `hosts/common/core/optional/`. +## Key Files & Directories +- `flake.nix`, `flake.lock`: Flake entrypoints +- `hosts/`, `home/`, `modules/`, `overlays/`: Core config structure +- `nixos-installer/`: Bootstrap/installer logic +- `docs/secretsmgmt.md`: Secrets management details +- `justfile`: Common developer commands --- - -If you are unsure about a workflow or pattern, check the referenced docs or ask for clarification in your PR. +If you are unsure about a pattern, check for similar logic in the `common/optional/` or `common/core/` directories, and follow the import structure used in host/user configs. diff --git a/home/panotaka/common/optional/desktops/hyprland/hyprlock.nix b/home/panotaka/common/optional/desktops/hyprland/hyprlock.nix index d678924..730da86 100644 --- a/home/panotaka/common/optional/desktops/hyprland/hyprlock.nix +++ b/home/panotaka/common/optional/desktops/hyprland/hyprlock.nix @@ -3,7 +3,7 @@ enable = true; }; - wayland.windowManager.hyprland.keybinds = [ + wayland.windowManager.hyprland.settings.bind = [ "$mod,L,exec,hyprlock" ];