# Repository Guidelines ## Project Structure & Module Organization This repository is a Den-based NixOS flake. `flake.nix` evaluates `./modules` through `import-tree`, so normal `.nix` files under `modules/` are auto-imported. - `modules/hosts/` contains host-specific composition and hardware data for `polaris` and `orion`. - `modules/features/` contains aspects such as desktop, shell, services, and Neovim. - `modules/profiles/` holds higher-level bundles such as `workstation.nix`. - `modules/users/` defines user metadata and per-user behavior. - `modules/secrets/` wires `sops-nix` and stores the encrypted `secrets.yaml`. - `.agents/den/` is a local checkout of Den with source, docs, and examples. Keep host files thin. Shared behavior belongs in `modules/features/` or `modules/profiles/`. When Den behavior is unclear, read `.agents/den/docs/`, `.agents/den/modules/`, and `.agents/den/templates/ci/` before guessing. ## Build, Test, and Development Commands Run commands from the repository root. - `nix build .#nixosConfigurations.polaris.config.system.build.toplevel --show-trace`: evaluate and build the Polaris system. - `nix build .#nixosConfigurations.orion.config.system.build.toplevel --show-trace`: evaluate and build the Orion system. - `nixos-rebuild build --flake .#`: use the standard rebuild path without activating it. - `nix fmt`: format Nix files using the flake-provided formatter. - `nix eval .#nixosConfigurations..config.