From 8bb542265c3b01f725c84cebc050b348fe2686e2 Mon Sep 17 00:00:00 2001 From: rito528 <39003544+rito528@users.noreply.github.com> Date: Wed, 22 Jul 2026 22:00:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20profile=20(personal/work)=20=E3=81=AE?= =?UTF-8?q?=E9=85=8D=E7=B7=9A=E5=9F=BA=E7=9B=A4=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 業務用マシンでは入れてよいソフトウェアが private 機と異なりうるため、 machines に profile を持たせ、identity と同様に extraSpecialArgs 経由で全モジュールへ配線する。許容外の値は assert で早期に検知する。 配線確認用に profile="work" の testuser-work エントリを追加。実際に profile でパッケージ等を出し分けるモジュール側の変更は行わない (次PRで業務要件を踏まえて対応する)。 Co-Authored-By: Claude Sonnet 5 --- flake.nix | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 3500c2b..fcb1610 100644 --- a/flake.nix +++ b/flake.nix @@ -55,7 +55,11 @@ ]; }; mkHomeConfig = - system: username: homeDirectory: identity: + system: username: homeDirectory: identity: profile: + assert builtins.elem profile [ + "personal" + "work" + ]; home-manager.lib.homeManagerConfiguration { pkgs = mkPkgs system; modules = [ @@ -67,6 +71,7 @@ username homeDirectory identity + profile takt ; }; @@ -100,6 +105,7 @@ email = "39003544+rito528@users.noreply.github.com"; gpgKey = "F4022307254812F8"; }; + profile = "personal"; }; testuser = { system = "x86_64-linux"; @@ -110,6 +116,7 @@ email = "testuser@example.com"; gpgKey = ""; }; + profile = "personal"; }; # aarch64-darwin 向け評価確認用。実 Mac 上の Unix ユーザー名は testuser のまま。 testuser-darwin = { @@ -121,13 +128,26 @@ email = "testuser@example.com"; gpgKey = ""; }; + profile = "personal"; + }; + # profile 配線確認用。実マシンではない。 + testuser-work = { + system = "x86_64-linux"; + username = "testuser"; + homeDirectory = "/home/testuser"; + identity = { + name = "testuser"; + email = "testuser@example.com"; + gpgKey = ""; + }; + profile = "work"; }; }; in { packages.x86_64-linux = npmPackages; homeConfigurations = builtins.mapAttrs ( - _: cfg: mkHomeConfig cfg.system cfg.username cfg.homeDirectory cfg.identity + _: cfg: mkHomeConfig cfg.system cfg.username cfg.homeDirectory cfg.identity cfg.profile ) machines; templates = { seichi-assist = {