You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f188cdd
Browse filesBrowse the repository at this point in the historyBrowse files
Evaluates a host's configuration without building it. Catches option conflicts and type errors fast — run this after editing any NixOS module or host config.
58
+
50
59
**Flake management:**
51
60
```bash
52
61
nix flake update --commit-lock-file
@@ -73,6 +82,22 @@ Secrets are organized using the principle of least privilege:
73
82
- Each host only has access to its own secrets plus admin keys
74
83
- Global secrets (if any) are defined in `lib/secrets/default.nix`
75
84
85
+
**agenix workflow:**
86
+
```bash
87
+
# Edit an existing secret (must be on a host with access, or have the deploy key):
88
+
agenix -e hosts/spore/secrets/some-secret.age
89
+
90
+
# Add a new secret:
91
+
# 1. Add an entry to lib/secrets/<host>.nix with the appropriate publicKeys
- Always pass the branch name explicitly to `gt create` — if omitted, Graphite auto-generates one from the commit message and may prepend a user prefix:
- Title format: `type: short description` — e.g. `fix: spore gc options`, `chore: update CLAUDE.md`, `feat: add ci eval job`
124
+
- Description should include a brief summary of what changed and what to test/verify
87
125
88
126
## Nix Commands
89
127
@@ -97,6 +135,37 @@ Never use `nix <subcommand> .#<output>` — the `#` causes permission prompt fai
97
135
|`nix run nixpkgs#foo`|`nixpkgs-run foo`|
98
136
|`nix shell nixpkgs#foo`|`nixpkgs-shell foo`|
99
137
138
+
## Common Patterns
139
+
140
+
**Amending the current branch:**
141
+
Use `gt modify` instead of `git commit --amend` to keep the Graphite stack consistent:
142
+
```bash
143
+
git add <files>
144
+
gt modify --no-edit # amend without changing message
145
+
gt modify -m "new message"# amend with new message
146
+
```
147
+
148
+
**`lib.mkForce` vs `lib.mkDefault`:**
149
+
-`lib.mkForce value` — host wins over any module default. Use when a host must diverge from a shared module.
150
+
-`lib.mkDefault value` — module loses to any host override. Use in shared modules to set a default that hosts can freely override without `mkForce`.
151
+
152
+
**Overriding a shared base module option in a host config:**
153
+
Use `lib.mkForce` when a host needs to diverge from a value set in a shared module (e.g. `modules/base/`). Without it, Nix will error on conflicting definitions.
- Before running commands like `ssh`, `nixos-rebuild`, or anything that targets a specific host, check which host Claude Code is running on (`hostname`) to avoid targeting the current machine unintentionally.
163
+
- The current host is typically `glyph` (NixOS desktop) or `Rhizome` (macOS laptop).
164
+
165
+
## Learning and Memory
166
+
167
+
- After arriving at a working solution through trial and error, proactively ask whether the finding should be recorded in CLAUDE.md (or Basic Memory) for future sessions.
0 commit comments