docs(nix): experimental featuresの呼び出し契約を明文化 - #75
Merged
Conversation
nix/darwin.nix の `nix.enable = false` により nix-darwin は /etc/nix/nix.conf を 生成せず、nix-command / flakes の有効・無効はホスト任せになる。Determinate Nix を 入れてあっても無効なホストは実在するため、「Determinate がデフォルト有効化済み」と いう記述を撤回し、bare な nix サブコマンドを呼ぶ側が用途単位で `--extra-experimental-features "nix-command flakes"` を明示する契約を明文化する。 Nix 設定そのものは所有せず、恒久的な有効化は Determinate 公式の管理経路に委ねる。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
決定
このリポジトリは Nix 本体の設定 (
/etc/nix/nix.conf) を所有しない。nix/darwin.nixのnix.enable = falseにより nix-darwin は nix.conf を生成せず(nix-darwin 側で managed config 一式がmkIf nix.enableに括られている)、nix.settings.experimental-featuresを書いても効かない。したがって nix-command / flakes の有効・無効はホスト任せで、Determinate Nix を入れてあっても無効なホストは実在する。この事実に合わせて:
nixサブコマンドを呼ぶ側が用途単位で--extra-experimental-features "nix-command flakes"を明示する契約にするdarwin-rebuildは自前で有効化して呼ぶ生成物なので明示不要変更
案内文・コメント・回帰テストのコメントのみ。実行ロジックは変更していない。
nix/darwin.nixnix.enable = falseのコメントを書き直し。nix.conf が nix-darwin の管理外になる帰結と呼び出し契約を明記AGENTS.mdnix/README.mdへポインタ)。主要コマンドのnix buildにフラグ追加。CI 検証節に、workflow 内が bare なのは installer action が有効化するためという例外説明を追加nix/README.mdnix例をすべてフラグ付きに修正(お試し表はコード block 化)README.mdnix run nix-darwinにフラグ追加 + 理由nix/scripts/install-nix.zshsetup/cutover.zshsetup/tests/cutover.bats診断手順として
grep -H experimental-features /etc/nix/nix.conf ~/.config/nix/nix.conf 2>/dev/null || trueを README に載せているが、include/NIX_CONFIG等の間接経路までは診断しないため「見つからない = 無効」とは断定せず、常にフラグを付ける方針として書いている。検証
このブランチで実行した結果:
契約の前提は実機で実測している(読み取りのみ):
/etc/nix/nix.confはbuild-users-group = nixbldの 1 行のみ。~/.config/nix/nix.conf不在、NIX_CONFIG未設定nix eval→experimental Nix feature 'nix-command' is disabled/ exit 1。フラグ付き →2.34.6/ exit 0determinate-nixdは存在する(= Determinate 導入済みでも無効)未実施
/etc/nix/nix.conf含む)darwin-rebuild switch/setup/migrate.zsh適用nix build/nix shellの実行closure ビルドの実行確認は
nix-checkworkflow に委ねる。