feat(shells): expose self' (raw-scan view) in evalContext - #2
Open
luochen1990 wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
feat-self-prime-20260726-0027
branch
from
July 26, 2026 02:21
391e1a1 to
0f79dfb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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的原始扫描结果self'结构性更强改动
lib/fhs-core.nix:mkEvalContext新增baseCtx和self'字段;allProjectDrvs重构为复用self'checks/self-prime.nix: 新增测试,验证self'在 devShell 中可用且不死锁AGENTS.md: 新增 "self': Project-Internal Outputs View" 章节验证
just checkexit 0,4/4 模板通过,17 checks 全绿just lint无死代码、无反模式