Commit f72895000701

Vincent Demeester <vincent@sbr.pm>
2026-02-04 22:11:57
chore(AGENTS.md): simplify it a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 9b89de7
Changed files (1)
AGENTS.md
@@ -1,29 +1,44 @@
-# AGENTS.md
+# Project
 
-This file provides guidance to AI coding agents when working with code in this repository.
+This is my homelab git repository. It is a comprehensive NixOS and home-manager monorepo for managing personal infrastructure, system configurations, and custom tools. It also has more "dynamic" configuration files in the `dots` folder.
 
-## Repository Overview
+## Building
 
-This is a comprehensive NixOS and home-manager monorepo for managing personal infrastructure, system configurations, and custom tools. The repository uses Nix flakes as the primary interface for building and deploying configurations across multiple machines.
+- Building host nixos configurations
+  - Use `make build` for testing the current host configuration (nixos).
+  - Use `make host/<hostname>/build` for testing a given host configuration.
+  - To test a host configuration without building, it's `make dry-build` or `make host/<hostname>/dry-build`.
+  - To deploy a host live, it's `make switch` or `make host/<hostname>/switch`.
+  - To deploy a host on next boot, it's `make boot` or `make host/<hostname>/boot`.
+  - You can get the list of hosts from the `flake.nix` configuration.
+- To build keyboards, there is a `keyboards/Makefile` for the targets.
+- In general, running `make help` will tell you what you can run/build.
+- Don't ever do commit unless you are being explicitely asked for it.
+- If you get asked to commit then use this rules:
+  - Follow Conventional Commits 1.0.0.
+  - 50 chars for title 70 chars for body.
+  - Cohesive long phrase or paragraph unless multiple points are needed.
+  - Use bullet points only if necessary for clarity.
+  - Past tense.
+  - State **what** and **why** only (no “how”).
+
+- **IMPORTANT: Never use `home-manager switch` or `nixos-rebuild` commands directly. Always use `make switch` or the appropriate make targets.**
 
 ## Architecture
 
-### Core Structure
+### Nix structure
 
 The repository follows a modular architecture centered around `flake.nix`:
 
-- **`/lib`**: Core library functions including `mkHost`, `mkHome`, and `mkSystemManager` for generating NixOS, home-manager, and system-manager configurations
 - **`globals.nix`**: Global configuration including machine definitions (network, SSH, syncthing), DNS zones, and VPN settings
 - **`/systems`**: NixOS system configurations, organized by hostname with a shared `/systems/common` directory containing base, desktop, hardware, programs, services, and users modules
-- **`/home`**: Home-manager configurations with `/home/common` containing desktop, dev, services, and shell modules
+- **`/home`**: Home-manager configurations with `/home/common` containing desktop, dev, services, and shell modules. Usually it gets build as part of systems.
 - **`/pkgs`**: Custom Nix packages that are exposed via overlays
 - **`/tools`**: Source code for custom tools (battery-monitor, emacs configuration)
 - **`/modules`**: Custom NixOS modules (wireguard-client, wireguard-server, govanityurl, gosmee)
 - **`/overlays`**: Nix overlays for additions, modifications, and unstable packages
-- **`/keyboards`**: Hardware keyboard configurations (ZMK for Corne, QMK for Moonlander, Kanata software remapper)
-- **`/imperative`**: Idempotent configuration scripts for non-NixOS managed systems, organized by hostname (e.g., `/imperative/nagoya/apply.sh`). These scripts are meant to be run repeatedly to maintain system state on hosts that cannot use NixOS.
 
-### Host Configuration Pattern
+#### Host Configuration Pattern
 
 Each host has a dedicated directory in `/systems/<hostname>` containing:
 - `boot.nix`: Boot configuration (bootloader, initrd, kernel modules)
@@ -31,148 +46,27 @@ Each host has a dedicated directory in `/systems/<hostname>` containing:
 - `extra.nix` (optional): Additional host-specific configuration
 - `home.nix` (optional): Host-specific home-manager configuration
 
-### System Types
-
-- **Unstable systems** (kyushu, aomi, sakhalin, foobar): Use `nixpkgs` (nixos-unstable)
-- **Stable systems** (athena, demeter, aix, aion, rhea, kerkouane): Use `nixpkgs-25_05` with specific hardware types like "rpi4" for Raspberry Pi 4
-
-### Package Management
+#### Package Management
 
 Custom packages are defined in `/pkgs/default.nix` and exposed through the `additions` overlay. They are built using standard Nix packaging functions (`pkgs.callPackage`). The repository provides packages for both x86_64-linux and aarch64-linux architectures.
 
-### Secrets Management
+#### Secrets Management
 
 Secrets are managed using agenix:
 - `secrets.nix` defines which secrets are encrypted for which hosts and users
 - Yubikeys are used for age encryption
 - Host SSH keys are used for system-level secret decryption
 
-## Common Commands
-
-Everything should happen using `make` (and `Makefile` accross the repository). You can use `make help` to figure out what it does.
-
-**IMPORTANT: Never use `home-manager switch` or `nixos-rebuild` commands directly. Always use `make switch` or the appropriate make targets.**
-
-### Building and Deploying Systems
-
-```bash
-# Build and switch the current system
-make switch
-
-# Build and activate on next boot
-make boot
-
-# Test build without switching
-make dry-build
-
-# Build a specific remote host
-make host/<hostname>/build
-
-# Deploy to a remote host (boot)
-make host/<hostname>/boot
-
-# Deploy to a remote host (switch)
-make host/<hostname>/switch
-```
-
-### Building Packages
-
-```bash
-# Build a single package
-nix build .#<package-name>
-
-# Install a package to your profile
-nix profile install .#<package-name>
-
-# List all available packages
-nix flake show
-```
-
-### Home Manager
-
-```bash
-# Update home-manager configuration
-home-manager switch --flake .#<username>@<hostname>
-```
-
-### Development
-
-```bash
-# Enter development shell
-nix develop
-
-# Format Nix files
-make fmt
-
-# Run pre-commit checks
-make pre-commit
-
-# Install git hooks
-make install-hooks
-```
-
-### Maintenance
-
-```bash
-# Clean old system generations (older than 15 days) and build results
-make clean
-
-# Update flake inputs
-nix flake update
-```
-
-## Pre-commit Hooks
-
-The repository uses pre-commit hooks configured in `flake.nix` for:
-- Go formatting (gofmt)
-- Nix formatting (nixfmt-rfc-style) and linting (deadnix)
-- Python linting (flake8, ruff)
-- Shell script checking (shellcheck)
-
-These run automatically via git hooks if installed with `make install-hooks`.
-
 ## Key Patterns
 
-### Adding a New Host
-
-1. Create `/systems/<hostname>` directory with `boot.nix` and `hardware.nix`
-2. Add host entry in `flake.nix` nixosConfigurations using `libx.mkHost`
-3. Add machine metadata to `globals.nix` (network IPs, SSH keys, syncthing ID if applicable)
-4. If using secrets, update `secrets.nix` with host SSH key
-
 ### Adding a New Package
 
 1. Create package directory in `/pkgs/<package-name>` with `default.nix`
 2. Add entry to `/pkgs/default.nix` using `pkgs.callPackage`
 3. Package will be available via `nix build .#<package-name>`
 
-### Modifying Desktop Environment
-
-Desktop configurations are in `/systems/common/desktop` and `/home/common/desktop`. The desktop type ("sway" or "niri") is specified when calling `mkHost` in `flake.nix` and conditionally imports desktop modules.
-
-## Testing
-
-For Go-based tools, run tests from the tool directory:
-```bash
-cd tools/<tool-name>
-go test ./...
-```
-
 ### Keyboard Firmware
 
-```bash
-# Build Moonlander QMK firmware in folder keyboards/moonlander of the git repository
-make keyboards/moonlander/build
-
-# Build eyelash_corne ZMK firmware in folder keyboards/eyelash_corne of the git repository
-make keyboards/eyelash_corne/build
-
-# Generate keymap SVGs for visualization
-make keyboards/draw                # Generate SVGs for all keyboards
-make keyboards/moonlander/draw     # Generate SVG for Moonlander only
-make keyboards/eyelash_corne/draw  # Generate SVG for Eyelash Corne only
-```
-
 ## Deployment Safety
 
 **IMPORTANT: Always ask for user confirmation before deploying to remote hosts.**
@@ -197,16 +91,3 @@ Examples of what to ask:
 - **Always write temporary scripts to `/tmp/`** instead of the home directory (`~/`)
 - Use descriptive names with appropriate extensions (e.g., `/tmp/fix-session-filenames.sh`)
 - Clean up temporary files after use with `rm` command
-- `/tmp/` files are automatically cleaned on system reboot
-
-### Working Directory
-- The working directory is `/home/vincent/src/home` which contains the main repository
-- Use relative paths when working within the repository structure
-- Use absolute paths when referencing files outside the repository
-
-## Special Notes
-
-- The repository uses XDG base directories for Nix configuration (enabled via `use-xdg-base-directories = true`)
-- Custom binary caches are configured: vdemeester.cachix.org, chapeau-rouge.cachix.org, nixos-raspberrypi.cachix.org
-- The `globals.nix` file contains sensitive network topology information and should be consulted when working with networking or machine-specific configurations
-- Some hosts use specific NixOS versions: stable hosts use 25.05, unstable hosts use nixos-unstable