feat: nix-darwin 導入の土台を追加する#492
Merged
Merged
Conversation
macOS 対応を home-manager 単独案から nix-darwin 導入案に変更。 darwinSystem + home-manager.darwinModules.home-manager を組み合わせ、 既存の home.nix / modules/*.nix をそのまま Linux・macOS 共通のユーザー 設定として再利用する形にした。 - nix-darwin input を追加 - mkDarwinConfig を追加 (mkHomeConfig と同じ引数構成: system/username/ homeDirectory/identity/profile) - modules/darwin/default.nix を新設。stateVersion・nix.enable=false・ homebrew (enable=false, cleanup="none") など最小限のみ - 評価専用の homeConfigurations.testuser-darwin を廃止し、 darwinConfigurations.testuser-darwin (nix-darwin 経由) に一本化 - CI の darwin 評価ステップを darwinConfigurations 経由に更新 実際の業務 Mac の darwinMachines エントリ追加、Homebrew の有効化・ taps/brews/casks の選定、システム設定の追加は行わない。実機が判明 した際に machines と同様1エントリ足すだけで使える状態を目指した。 Co-Authored-By: Claude Sonnet 5 <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.
Summary
nix-darwininput を追加し、mkHomeConfigと同じ引数構成 (system/username/homeDirectory/identity/profile) のmkDarwinConfigを新設。darwinSystem+home-manager.darwinModules.home-managerを組み合わせ、既存のhome.nix/modules/*.nixをそのまま Linux・macOS 共通のユーザー設定として再利用するmodules/darwin/default.nixを新設(最小限):system.stateVersion、nix.enable = false、homebrew(enable = false,onActivation.cleanup = "none")homeConfigurations.testuser-darwin(PR#490 で追加、home-manager 単独)を廃止し、darwinConfigurations.testuser-darwin(nix-darwin 経由)に一本化nix.yaml) の darwin 評価ステップをdarwinConfigurations経由に更新このPRは土台のみ。実際の業務 Mac の
darwinMachinesエントリ追加・Homebrew の有効化・taps/brews/casks の選定・システム設定の追加は行わない。実機入手後にやること
flake.nixのdarwinMachinesに実エントリを追加する(username/homeDirectory/identity/profileを実機の値に書き換えるだけ)modules/darwin/default.nixのnix.enableをその方法に合わせて調整するdarwin-rebuild switch --flake .#<name>を実行し、実際にビルド・適用できることを確認する(今回のPRは評価レベルの確認までで、実ビルドは未検証)modules/actrun.nix/modules/git-wt.nix(Linux バイナリ直指定)やbubblewrap(Linux 専用パッケージ)が失敗する可能性が高いので、Darwin 対応するmodules/darwin/default.nixのhomebrew.enable = trueにし、taps/brews/casks を定義する(onActivation.cleanupは"none"のまま維持し、宣言外のソフトウェアを消さないようにする)profile = "work"で実際に何を除外するかを決め、modules/packages.nix等で出し分けを実装するTest plan
nix run nixpkgs#nixfmt -- --check flake.nix modules/darwin/default.nixnix flake check .(既存 Linux 側が壊れていないこと)nix eval .#darwinConfigurations.testuser-darwin.config.home-manager.users.testuser.home.username→"testuser"nix eval .#darwinConfigurations.testuser-darwin.config.system.primaryUser→"testuser"nix eval .#darwinConfigurations.testuser-darwin.config.home-manager.users.testuser.programs.git.settings.user.email→identityの配線を確認nix eval .#darwinConfigurations.testuser-darwin.config.homebrew.enable→falsesystem.build.toplevelは実ビルドできないため評価レベルの確認に留めた。実機でのdarwin-rebuild switchは Mac 実機入手後に確認する)🤖 Generated with Claude Code