feat(claude): seed curated CLAUDE.md files into ~/dev/ workspace

Adds the omnixy-pattern out-of-store-symlink wiring so consumers can
opt into Claude Code orientation without copying anything by hand.
Files live in lnbits-sensei (so they evolve via PR), symlinks point
back at the consumer's checkout (so edits take effect on the next
Claude session without a nixos-rebuild).

New files under files/:

- dev-CLAUDE.md — generic workspace orientation. Workspace layout,
  quick command set, pointers to docs/. Opt-in (clobbers an existing
  ~/dev/CLAUDE.md, so off by default).
- lnbits-CLAUDE.md — per-project orientation for the lnbits worktree
  subtree. Inline summary of the four most-stepped-on gotchas
  (settings precedence, Quasar UMD self-closing rule, auth-decorator
  distinctions, upstream PR target = `dev` not `main`) plus pointers
  to the docs/ for full reference.

New options under lnbits-sensei.devEnv:

- scaffoldPath — absolute path to the consumer's lnbits-sensei
  checkout. types.str (not types.path) intentionally: types.path
  would copy the file into the Nix store and defeat
  mkOutOfStoreSymlink. Required when any claude.* flag is on.
- claude.enable — seeds ~/dev/lnbits/CLAUDE.md.
- claude.workspaceOrientation — additionally seeds ~/dev/CLAUDE.md.

Wiring lives in home.nix (gated via `osConfig.lnbits-sensei.devEnv.*`)
rather than the dev-env NixOS module, since the file destinations are
under home-manager's purview and the home-manager scope is where
`mkOutOfStoreSymlink` is in scope.

`nix flake check` stays green — `optionalAttrs` is lazy, so
`scaffoldPath` isn't accessed when claude.{enable,workspaceOrientation}
are both false (their defaults).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-26 00:54:55 +02:00
commit 0a5713c704
5 changed files with 242 additions and 0 deletions

View file

@ -35,4 +35,25 @@
# Future passes: shell prompt, editor, lnbits dev shell aliases,
# direnv integration, tmux launcher, etc. Keep this file thin and
# delegate behaviour to modules/.
# CLAUDE.md seeding — symlinks under ~/dev/ that point at files
# tracked in your lnbits-sensei checkout, so Claude sessions in the
# workspace pick up the curated orientation automatically. Gated on
# `lnbits-sensei.devEnv.claude.*` options in the NixOS config.
#
# `mkOutOfStoreSymlink` keeps the link pointed at your live checkout
# (not the Nix store), so editing the source file takes effect on
# the next Claude session without a rebuild.
home.file = lib.mkMerge [
(lib.optionalAttrs osConfig.lnbits-sensei.devEnv.claude.enable {
"dev/lnbits/CLAUDE.md".source =
config.lib.file.mkOutOfStoreSymlink
"${osConfig.lnbits-sensei.devEnv.scaffoldPath}/files/lnbits-CLAUDE.md";
})
(lib.optionalAttrs osConfig.lnbits-sensei.devEnv.claude.workspaceOrientation {
"dev/CLAUDE.md".source =
config.lib.file.mkOutOfStoreSymlink
"${osConfig.lnbits-sensei.devEnv.scaffoldPath}/files/dev-CLAUDE.md";
})
];
}