Skip to content

feat(shells): expose self' (raw-scan view) in evalContext - #2

Open
luochen1990 wants to merge 1 commit into
masterfrom
feat-self-prime-20260726-0027
Open

feat(shells): expose self' (raw-scan view) in evalContext#2
luochen1990 wants to merge 1 commit into
masterfrom
feat-self-prime-20260726-0027

Conversation

@luochen1990

Copy link
Copy Markdown
Owner

See forgejo PR: https://git.lambda.lc/lc-studio/flake-fhs/pulls/3

任务意图

evalContext 中暴露 self' 字段(system-resolved raw-scan view),让 shells/*.nix 等用户代码可以方便地引用本 flake 自身的 packages/apps/checks derivation,且不会造成无限递归

核心设计(路线 2:原始扫描视图)

  • self'.packages / .apps / .checks 直接来自 loadScopedOutputs 的原始扫描结果
  • 依赖图是 DAG(无环),比 flake-parts 的 self' 结构性更强

改动

  • lib/fhs-core.nix: mkEvalContext 新增 baseCtxself' 字段;allProjectDrvs 重构为复用 self'
  • checks/self-prime.nix: 新增测试,验证 self' 在 devShell 中可用且不死锁
  • AGENTS.md: 新增 "self': Project-Internal Outputs View" 章节

验证

  • just check exit 0,4/4 模板通过,17 checks 全绿
  • just lint 无死代码、无反模式
  • Code Review + Simplify 已完成(无 blocker)

Add a system-resolved raw-scan view of the project's own packages/apps/checks
to evalContext, so shells/*.nix can consume them via self'.packages / .apps /
.checks without infinite recursion. The view is built from loadScopedOutputs
(the same intermediate used to assemble final flake outputs), keeping the
dependency graph a DAG — unlike flake-parts' self', which points to the final
outputs and relies on lazy evaluation to break the cycle.
@luochen1990
luochen1990 force-pushed the feat-self-prime-20260726-0027 branch from 391e1a1 to 0f79dfb Compare July 26, 2026 02:21
@luochen1990 luochen1990 changed the title WIP: feat(shells): expose self' in evalContext feat(shells): expose self' (raw-scan view) in evalContext Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant