a lot of meow
This commit is contained in:
@@ -95,6 +95,39 @@ nix run .#sops-encrypt <file>
|
||||
nix develop
|
||||
```
|
||||
|
||||
## Validating Config Changes
|
||||
|
||||
Standard validation sequence before relying on any edit to a `.nix` module (used for opencode, ai, and other module changes):
|
||||
|
||||
1. **Parse check** (fast, catches syntax/brace errors):
|
||||
```bash
|
||||
nix-instantiate --parse config/modules/ai/ai.nix >/dev/null && echo "PARSE OK"
|
||||
```
|
||||
2. **Hash verification** for any downloaded file pinned via `pkgs.fetchurl` — compute the sha256 locally and confirm it matches the `sha256` in the module:
|
||||
```bash
|
||||
nix hash file token-tracker.tsx # or: sha256sum token-tracker.tsx
|
||||
```
|
||||
3. **Flake evaluation** — full `nix flake check` may fail on unrelated pre-existing issues (e.g. `<den/primary-user>` not on NIX_PATH in pure mode). Distinguish pre-existing failures from edit-induced ones before touching the code. `nix flake show --impure` lists the configuration names (`nixosConfigurations: desktop, doloro-bootable, laptop, rpi5, wsl`).
|
||||
4. **Runtime output check** — the generated config is a home-manager symlink into `/nix/store`. After a rebuild, confirm the live files actually contain the change:
|
||||
```bash
|
||||
readlink -f ~/.config/opencode/opencode.json # → /nix/store/...-opencode.json
|
||||
rg -n "my-change" "$(readlink -f ~/.config/opencode/opencode.json)"
|
||||
```
|
||||
Also verify supporting files that the change depends on (plugins dir, extra packages, etc.):
|
||||
```bash
|
||||
ls -la ~/.config/opencode/plugins/ && readlink -f ~/.config/opencode/plugins/*.tsx
|
||||
```
|
||||
5. **Cache check** for npm-resolved opencode plugins — confirm opencode actually downloaded the package into its plugin cache:
|
||||
```bash
|
||||
ls ~/.cache/opencode/packages/ | rg "plugin-name"
|
||||
```
|
||||
If the package is absent or an old version, the plugin won't load regardless of config.
|
||||
6. **Log check** — search opencode's log for plugin-load errors, filtering out your own tool-call noise:
|
||||
```bash
|
||||
rg -i "plugin" ~/.local/share/opencode/log/opencode.log | rg -v "evaluated permission" | tail -30
|
||||
```
|
||||
7. **Config is loaded once at startup** — a running opencode session keeps the config it loaded at launch. After changing any config file, restart opencode (and run a home-manager rebuild first) before expecting the change to take effect.
|
||||
|
||||
## Important Notes
|
||||
|
||||
- `allowUnfree = true` globally for proprietary packages (Steam, Spotify, etc.)
|
||||
|
||||
Reference in New Issue
Block a user