Imported from lvanasse/dotfiles (
AGENTS.md). Install upstream withnpx skills add lvanasse/dotfiles. Copyright stays with the author.
Repository Guidelines
Architecture
This repository uses a flake-based NixOS/Home Manager setup with flake-parts and import-tree.
Dendritic layout:
modules/contains reusable modules that self-register underflake.modules.*.hosts/contains host-specific configs that are explicitly registered inhosts/default.nix.
Module naming patterns:
profile.*for bundles (for exampleprofile.workstation,profile.server)desktop.*for desktop stacksservices.*for servicesfeature.*for optional featureshost.*for host entrypoints
Project Structure
flake.nix: flake entrypoint and outputs wiring.hosts/default.nix: host matrix and module registration.hosts/<host>/: per-host NixOS entrypoint + Home Manager overrides.modules/flake/: custom lib/helpers, overlays, packages, checks, formatter.modules/nixos/: shared NixOS modules.modules/home/: shared Home Manager modules.wallpapers/: desktop assets.
Build, Test, and Development Commands
- Switch NixOS host:
nh os switch -H pc(orlaptop,server). - Apply Home Manager:
home-manager switch --flake .#ludovic@pc. - Unified switch command:
nohm <host>. - Validate:
nix flake checkandnixos-rebuild dry-run --flake .#pc. - Format:
nix fmt(ornixfmt-rfc-style **/*.nix). - Update inputs:
nix flake updateand commitflake.lock.
Coding Style & Naming
- Use 2-space indentation in Nix files.
- Use kebab-case filenames for modules.
- Use
hostname.nixnaming for host entrypoints. - Use camelCase for Nix attributes and kebab-case package names.
- Keep changes minimal, modular, and focused.
Testing Guidelines
- Manual testing only: evaluate and activate on target host(s).
- For shared changes, test both
pcandlaptopwhen applicable. - Typical flow: edit ->
nh os switch -H <host>->home-manager switch --flake .#ludovic@<host>-> runtime verification.
Adding Hosts and Services
Adding a host:
- Create
hosts/<hostname>/with<hostname>.nix,home.nix, and generatedhardware-configuration.nix. - Register it in
hosts/default.nixunder both host matrix andflake.modules.nixos/homeManager."host.<hostname>".
Adding a service module:
- Create
modules/nixos/services/<service>.nix. - Register as
flake.modules.nixos."services.<service>". - Include it from the relevant profile module.
Commit Guidelines
- Use
scope: brief description(for examplepc: enable flathub,home: add Java support). - Suggested scopes:
pc,laptop,server,home,modules,doc,fix,cleanup. - Keep one logical change per commit and note hosts tested + commands run.
Security Notes
- Never hand-edit
hosts/*/hardware-configuration.nix. - SSH hardening and firewall settings are host-controlled; keep changes explicit and reviewable.
Agent Notes
- Keep patches focused and avoid unrelated edits.
- Respect the
modules/vshosts/separation. - When adding modules, ensure they are correctly wired through host/profile imports.
- Prefer Fish-compatible commands when giving the user shell snippets; if Bash syntax is required, say so explicitly and wrap it with
bash -lc.