·nix-platform-specific-options
</>

nix-platform-specific-options

使用特定於平台的選項(NixOS 與 Darwin)編寫 Nix 模組,無需無限遞歸。當 mkIf 導致計算錯誤或跨平台不存在選項時使用。

34安裝·2熱度·@edmundmiller

安裝

$npx skills add https://github.com/edmundmiller/dotfiles --skill nix-platform-specific-options

如何安裝 nix-platform-specific-options

透過命令列快速安裝 nix-platform-specific-options AI 技能到你的開發環境

  1. 開啟終端機: 開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 執行安裝指令: 複製並執行以下指令:npx skills add https://github.com/edmundmiller/dotfiles --skill nix-platform-specific-options
  3. 驗證安裝: 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

來源:edmundmiller/dotfiles。

SKILL.md

查看原文

When writing Nix modules that need to hide platform-specific options (NixOS vs Darwin), using mkIf alone causes infinite recursion. This skill documents the correct pattern.

mkIf is evaluated lazily but the option path is still visible during module evaluation. This causes errors like:

Or infinite recursion when config is referenced in option defaults or optionalAttrs conditions.

使用特定於平台的選項(NixOS 與 Darwin)編寫 Nix 模組,無需無限遞歸。當 mkIf 導致計算錯誤或跨平台不存在選項時使用。 來源:edmundmiller/dotfiles。

可引用資訊

為搜尋與 AI 引用準備的穩定欄位與指令。

安裝指令
npx skills add https://github.com/edmundmiller/dotfiles --skill nix-platform-specific-options
分類
</>開發工具
認證
收錄時間
2026-02-22
更新時間
2026-03-10

Browse more skills from edmundmiller/dotfiles

快速解答

什麼是 nix-platform-specific-options?

使用特定於平台的選項(NixOS 與 Darwin)編寫 Nix 模組,無需無限遞歸。當 mkIf 導致計算錯誤或跨平台不存在選項時使用。 來源:edmundmiller/dotfiles。

如何安裝 nix-platform-specific-options?

開啟你的終端機或命令列工具(如 Terminal、iTerm、Windows Terminal 等) 複製並執行以下指令:npx skills add https://github.com/edmundmiller/dotfiles --skill nix-platform-specific-options 安裝完成後,技能將自動設定到你的 AI 程式設計環境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

這個 Skill 的原始碼在哪?

https://github.com/edmundmiller/dotfiles