This repository has been archived on 2026-06-22. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
lnbits-sensei/home.nix
Padreug 0a5713c704 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>
2026-05-26 00:54:55 +02:00

59 lines
2 KiB
Nix

# lnbits-sensei — home-manager user config.
#
# Placeholder shell. Substantive home-manager wiring (shell, editor,
# git identity, dev shell aliases) lands in follow-up passes once the
# module skeleton settles.
{
config,
pkgs,
lib,
settings,
osConfig,
...
}:
{
home.username = settings.user;
# `lib.mkForce` because home-manager's nixos module sets a default
# homeDirectory of /var/empty that we always want to override.
home.homeDirectory = lib.mkForce "/home/${settings.user}";
# State version pins the schema of files this generation produces.
# Match the NixOS stateVersion in configuration.nix.
home.stateVersion = "24.11";
# Git identity is sourced from settings.nix so it is set exactly once
# for the whole host.
programs.git = {
enable = true;
settings.user = {
name = settings.gitName;
email = settings.gitEmail;
};
};
# 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";
})
];
}