← スキル一覧に戻る

configuring-layers
by khaneliman
configuring-layersは、ソフトウェア開発を効率化するスキルです。開発ワークフロー全体をサポートし、チームの生産性向上とコード品質の改善を実現します。
⭐ 303🍴 14📅 2026年1月23日
SKILL.md
name: configuring-layers description: "khanelinix 7-level configuration hierarchy and customization strategy. Use when deciding where to put customizations, understanding override precedence, resolving option conflicts, or working with host/user specific configs."
Configuration Layering
7-Level Hierarchy
From lowest to highest precedence:
- Common modules - Cross-platform base functionality
- Platform modules - OS-specific (nixos/darwin)
- Home modules - User-space applications
- Suite modules - Grouped functionality with defaults
- Archetype modules - High-level use case profiles
- Host configs - Host-specific overrides
- User configs - User-specific customizations (highest priority)
Quick Decision Tree
Question: Where should I put this configuration?
- Does it require sudo/root access? → System modules (
nixos/ordarwin/) - Is it hardware-specific? → Host config (
systems/{arch}/{hostname}/) - Is it user-preference specific? → User config
(
homes/{arch}/{user@host}/) - Does it configure user applications? → Home modules (
modules/home/) - Is it shared across platforms? → Common modules (
modules/common/)
Still unsure? Default to home modules - they're easiest to test and most portable.
Customization Strategy
| What to customize | Where |
|---|---|
| Host hardware/services | systems/{arch}/{hostname}/ |
| Platform behavior | modules/nixos/ or modules/darwin/ |
| User applications | modules/home/ |
| Personal preferences | homes/{arch}/{user@host}/ |
Host Configuration
systems/{arch}/{hostname}/
├── default.nix # Host-specific system config
└── hardware.nix # Hardware-specific settings
Example: systems/x86_64-linux/khanelimain/default.nix
User Configuration
homes/{arch}/{username@hostname}/
├── default.nix # User-specific home config
└── packages.nix # User-specific packages
Example: homes/x86_64-linux/khaneliman@khanelimain/default.nix
Override Precedence
# In module (low priority - can be overridden)
programs.git.userName = lib.mkDefault "Default Name";
# In host config (overrides module default)
programs.git.userName = "Host Specific";
# Force (highest priority - rarely needed)
programs.git.userName = lib.mkForce "Forced Value";
Override Patterns by Use Case
Pattern 1: Testing a new value (keep module default)
# In home config - temporarily override
programs.git.userName = "Test Name"; # Plain assignment
# Module default still exists for other hosts
Pattern 2: Setting project-wide standard (weak default)
# In module
programs.git.userName = lib.mkDefault "Default Name";
# Easily overridden in host/user configs
Pattern 3: Enforcing a requirement (strong override)
# In security-critical module
security.sudo.wheelNeedsPassword = lib.mkForce true;
# Cannot be overridden by downstream configs
Common Override Scenarios
Scenario: Different git config per host
# modules/home/programs/terminal/tools/git/default.nix
programs.git.userName = lib.mkDefault "khaneliman";
# homes/x86_64-linux/khaneliman@workhost/default.nix
programs.git.userName = "Work Name"; # Overrides for this host
# homes/x86_64-linux/khaneliman@personalhost/default.nix
# Uses module default ("khaneliman")
Scenario: Override theme but not fonts
# Suite sets defaults
khanelinix.user.theme = lib.mkDefault "catppuccin-mocha";
khanelinix.user.font.mono = lib.mkDefault "JetBrainsMono";
# User overrides just theme
khanelinix.user.theme = "gruvbox"; # Plain assignment overrides mkDefault
# Font remains JetBrainsMono from suite
Best Practice
Prefer customization in this order:
- Home configuration wherever possible
- Host config for hardware/host-specific
- Platform modules for OS-specific behavior
- Common modules for shared base functionality
See Also
- Module placement: See scaffolding-modules for determining where to place configuration
- Option design: See designing-options for creating properly namespaced options
スコア
総合スコア
65/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です
