Skip to content

feat(nix): devenv の binary cache をグローバル設定に追加 - #55

Merged
thinceller merged 1 commit into
masterfrom
feat/devenv-cachix
Aug 29, 2026
Merged

feat(nix): devenv の binary cache をグローバル設定に追加#55
thinceller merged 1 commit into
masterfrom
feat/devenv-cachix

Conversation

@thinceller

Copy link
Copy Markdown
Owner

背景

devenv を使う flake (例: trihermes) で direnv 経由の shell 進入時に毎回以下の警告が出ていた。

warning: ignoring untrusted flake configuration setting 'extra-substituters'.
Pass '--accept-flake-config' to trust it
warning: ignoring untrusted flake configuration setting 'extra-trusted-public-keys'.

その flake が nixConfig で devenv の cachix を宣言しているが、こちらの nix 設定が
accept-flake-config = false であり、direnv は非対話のため確認プロンプトを出せず無視される。
結果として devenv.cachix.org が使われず、devenv 関連の derivation をローカルビルドしうる。

accept-flake-config = true は任意の flake の設定を無条件に信頼することになるので採らず、
グローバルの nix.settings に substituter を明示追加する方針とした。

変更内容

nix-darwin/modules/nix.nixnix.settings に追加:

  • extra-substituters: https://devenv.cachix.org
  • extra-trusted-public-keys: devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=

デフォルトの cache.nixos.org を潰さないよう extra- プレフィックスを使用。
コメントの書き方・リストの並べ方は nixos/modules/common.nix の同種の設定に合わせている。

nixos (oberon) 側には追加していない。リポジトリ内に devenv の参照がなく、
oberon で devenv を使っている形跡がないため。

検証

  • nix fmt → 105 files, 0 changed
  • nix build .#darwinConfigurations.kohei-m4-mac-mini.system --no-link → 成功
  • nix build .#darwinConfigurations.SC-N-843.system --no-link → 成功
  • ビルド成果物の etc/nix/nix.conf に以下が出力され、substituters = https://cache.nixos.org/
    維持されていることを確認済み
extra-substituters = https://devenv.cachix.org
extra-trusted-public-keys = devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=

switch 後の nix config show | grep substituters での確認は未実施。

🤖 Generated with Claude Code

https://claude.ai/code/session_01B728bRGMNmi5y46N3Xwe1H

devenv を使う flake が nixConfig で宣言する devenv.cachix.org は、
accept-flake-config = false のため direnv 経由の非対話な shell 進入では
untrusted 扱いで無視され、devenv 関連の derivation をローカルビルドしうる。
任意の flake 設定を無条件に信頼する accept-flake-config は使わず、
nix.settings に extra-substituters として明示追加する。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B728bRGMNmi5y46N3Xwe1H
@github-actions

Copy link
Copy Markdown

Nix Diff

Compare changes

kohei-m4-mac-mini

Attribute: darwinConfigurations.kohei-m4-mac-mini.system

Diff Output
<<< /nix/store/1lhzragqfvk2r2na7h07aw7a1mpmnk1h-darwin-system-26.11.d8a6661.drv
>>> /nix/store/29yba8hmgrsna9xbww8wnpw6nvkw3psb-darwin-system-26.11.d8a6661.drv

PATHS: 14457 -> 14457 (+3, -3)
SIZE: 411 MiB -> 411 MiB
DIFF: 144 bytes

SC-N-843

Attribute: darwinConfigurations.SC-N-843.system

Diff Output
<<< /nix/store/p894xyri85246r9aqg6iyh2z2qqdwszl-darwin-system-26.11.d8a6661.drv
>>> /nix/store/fifxbvzgwga0cijpnx8czk2ysgl55fnz-darwin-system-26.11.d8a6661.drv

PATHS: 12745 -> 12745 (+3, -3)
SIZE: 292 MiB -> 292 MiB
DIFF: 136 bytes

📄 View diff as HTML in the Artifacts section


Generated by nix-diff-action using dix

@thinceller
thinceller merged commit f5bdf5f into master Aug 29, 2026
4 checks passed
@thinceller
thinceller deleted the feat/devenv-cachix branch August 29, 2026 15:34
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