From 2cd41bcd1605bf5bf98d31a096a16f6276082070 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Wed, 15 Apr 2026 04:08:16 +0800 Subject: [PATCH] =?UTF-8?q?docs(agents):=20=E8=A1=A5=E5=85=85=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E5=91=BD=E4=BB=A4=E5=92=8C=E6=B3=A8=E6=84=8F=E4=BA=8B?= =?UTF-8?q?=E9=A1=B9=EF=BC=8C=E5=AE=8C=E5=96=84=E6=9E=B6=E6=9E=84=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1f32b8b..d87240a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,33 +19,40 @@ flake.nix - `modules/nixos/` — system packages, locale, docker, user - `home/` — home-manager (shared, `useGlobalPkgs`), catppuccin - `hosts/*/` — per-host overrides -- `overlays/` + `pkgs/` — custom packages +- `overlays/` + `pkgs/` — custom packages (`comment-checker`) Flow: `hosts/*` → `modules/*` → `home/*` ## Commands ```bash -just rebuild mac-mini # macOS host +just rebuild mac-mini # macOS host (darwin-rebuild) just rebuild macbook-air -just rebuild wsl # NixOS host -just check # eval without building +just rebuild wsl # NixOS host (nixos-rebuild) +just check # eval without building (platform-aware) just update # nix flake update just up nixpkgs # update single input just clean # nix-collect-garbage -d (user-level only) +just rollback # NixOS only — rollback to previous generation +just history # list system profile generations +just show # nix flake show just lsp mac-mini # nixd option completion for VSCode ``` +Note: `just check` and `just rebuild` have `[macos]`/`[linux]` variants — the justfile auto-selects by platform. + ## Gotchas - **Shared settings in `modules/shared/`** — don't re-declare fish/openssh/1password/fonts in platform modules. - **`sshKeys` centralized** in `lib/default.nix` via `specialArgs`. Don't hardcode. - **WSL aliases force-cleared** — `hosts/wsl/default.nix` uses `lib.mkForce {}`. All aliases via Home Manager only. -- **Neovim = lazyvim-nix** — `programs.lazyvim` in `home/dev/neovim.nix`. `catppuccin.nvim.enable = false` (LazyVim manages colorscheme). +- **Neovim = lazyvim-nix** — `programs.lazyvim` in `home/dev/neovim.nix`. `catppuccin.nvim.enable = false` (LazyVim manages colorscheme). The `lazyvim.homeManagerModules.default` is loaded as a sharedModule in `lib/default.nix`. - **catppuccin modules** — `catppuccin.homeModules.catppuccin` (home), `catppuccin.nixosModules.catppuccin` (NixOS). Not the old `homeManagerModules`. -- **Homebrew `cleanup = "zap"`** — undeclared casks/brews get removed. Shared → `modules/darwin/`, host-specific → `hosts/*/`. Tap casks need full path (e.g. `"goooler/repo/fl-clash"`). -- **Ghostty macOS-only** — `package = null` (Homebrew cask). Terminfo propagated via `ghostty.terminfo` in `modules/nixos/`. +- **Homebrew `cleanup = "zap"`** — undeclared casks/brews get removed. `greedyCasks = true` upgrades even auto-updating casks. Shared → `modules/darwin/`, host-specific → `hosts/*/`. Tap casks need full path (e.g. `"goooler/repo/fl-clash"`). +- **Ghostty macOS-only** — `enable = pkgs.stdenv.isDarwin`, `package = null` (Homebrew cask). Terminfo propagated via `ghostty.terminfo` in `modules/nixos/`. - **nix-ld on WSL** — `programs.nix-ld.enable = true` for VSCode Remote. +- **home-manager `backupFileExtension = "bak"`** — set in `lib/default.nix`. Existing dotfiles get `.bak` suffix on conflict. +- **mise** — runtime version management (`home/dev/languages.nix`). `trusted_config_paths = [ "/" ]` trusts all config files. ## Environment @@ -72,7 +79,7 @@ Use the new names: - LSP: `nixd`. Formatter: `nixfmt`. Linter: `statix`. - All in `home/dev/languages.nix`. -- `just lsp ` generates `.vscode/settings.json` (gitignored). +- `just lsp ` generates `.vscode/settings.json` from `.vscode/settings.base.json` (gitignored output). ## Tool usage