nixos-specialisation-tuning

nixos-specialisation-tuning is a skill for Claude Code, Codex from Kihara777/NixKits. It costs 124 tokens per session (6,644 once invoked), scanned A, original, MIT.

A guide for configuring NixOS, the declarative Linux operating system, with selectable system variants and for tuning local llama.cpp model serving. It covers a minimal default system, optional desktop settings, model parameters, and diagnosis of silent failures.

In plain words
What is it for?
Use it to create headless and desktop NixOS variants, configure services on unified-memory hardware, adjust model thinking and context settings, and investigate failed or degraded local inference.
Why use it?
It helps keep shared and variant-specific settings from conflicting, especially when one setting can accidentally remove required system tools. It also provides a way to assess local model changes by their cost, benefit, and trade-offs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./spec/core.nix # 默认面.

Good fit Use it to create headless and desktop NixOS variants, configure services on unified-memory hardware, adjust model thinking and context settings, and investigate failed or degraded local inference.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Kihara777/NixKits
agentmods
npx agentmods add skills/kihara777/nixkits/nixos-specialisation-tuning

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nixos-specialisation-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/kihara777/nixkits/nixos-specialisation-tuning/github.svg)](https://agentmods.dev/skills/kihara777/nixkits/nixos-specialisation-tuning)
Your own site
<a href="https://agentmods.dev/skills/kihara777/nixkits/nixos-specialisation-tuning"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/nixos-specialisation-tuning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nixos-specialisation-tuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/kihara777/nixkits/nixos-specialisation-tuning"><img src="https://agentmods.dev/badge/skills/kihara777/nixkits/nixos-specialisation-tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,644 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00124 $0.06644
Opus 5.5 $0.00050 $0.02658
Sonnet 5.5 $0.00025 $0.01329
Haiku 4.5 $0.00012 $0.00664

Measured 23d ago against content hash be1122f93801, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nixos-specialisation-tuning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 23d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/nixos-specialisation-tuning/SKILL.md · 466 lines

How it starts

The opening of the file, as written. The whole thing — 466 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NixOS 分面设计与本地推理调优

用于两类任务:把 NixOS 配置拆成多个启动面,以及在统一内存设备上让本地大模型跑得动、跑得对、跑得快。

适用场景

  • 需要"默认精简 + 可选全功能"两套配置,开机菜单选择
  • 改动引导器 / 调整默认引导面后系统无法启动
  • 分面热切换后服务看似"切成功了"但功能不对(无桌面、D-Bus 服务无法激活)
  • 本地 llama.cpp 服务出现输出退化、加载失败、速度异常
  • 需要判断某项优化是否值得(要求给出成本/收益/代价,而非单一收益)

分面架构

三文件布局

文件 职责 原则
spec/<默认面>.nix 默认配置(如 headless core) 只 import 必需模块
spec/<可选面>.nix specialisation.<name>.configuration 叠加在默认面之上
system/base.nix 两面共用的模式无关底座 不含只服务某一面的配置
# flake.nix
nixosConfigurations.HOST.modules = [
  ./spec/core.nix                       # 默认面
  { specialisation.plasma.configuration = {
      imports = [ ./spec/plasma.nix ];  # 可选面
    };
  }
];

覆盖与冲突

共用模块中的值用 lib.mkDefault 声明,供分面用普通赋值覆盖:

# base/core 中
networking.wireless.iwd.enable = lib.mkDefault true;

# plasma 中覆盖
networking.wireless.iwd.enable = lib.mkForce true;

陷阱:lib.mkForce 覆盖整个属性时,会连带删掉其它模块对该属性的贡献。

⚠️ 实战案例:core 曾用 lib.mkForce 覆盖 environment.systemPackages,把 base 层提供的 bash 与 systemd 一并删除,导致无法登录、systemctl/reboot 全部缺失。 规则:systemPackages 类列表用追加,不用 mkForce 覆盖。

面向消费者的归属原则

一个配置项应放在它的消费者所在模块,而非"共用的那个文件"。

⚠️ 实战案例:为给 mihomo 腾出 53 端口而设置的 DNSStubListener=no,起初写进了共用的 base.nix。这会让不使用 mihomo 的面也无谓地失去 DNS stub。 判据:若某个面不启用该消费者,它就不该承受这个副作用。

引导菜单与默认面

分面意味着同一个系统有多个可引导入口,故引导器的配置也属于分面设计的一部分。

不要用命令式手段改写引导器生成的文件

规则:引导器配置必须通过其 Nix 选项声明,不得用 sed/cp 等命令式手段在 install 钩子里改写生成物。

⚠️ 实战事故(本机实际发生,导致系统无法启动)

需求:上游 nixpkgs 把 Limine 默认项硬编码为"有 specialisation 就选第 3 项" (limine-install.py:533),故只要存在可选面,默认就进可选面而非默认面。 为改回默认面,用了 extraInstallCommands 在 install 之后 sed 改写 limine.conf 的 default_entry。

失败机制——钩子执行在哈希固化之后:

limine-install.py:660  enrollConfig=true
  → b2sum = blake2b(config_file.strip())       # 对配置内容算哈希
  → limine enroll-config <BOOTX64.EFI> <hash>  # 固化进 EFI 二进制

limine.nix:471         ${install} "$@"           ← 哈希固化在此完成
limine.nix:472         ${cfg.extraInstallCommands} ← sed 在此改写配置

改写发生在固化之后 → 哈希不匹配 → Secure Boot 下引导器拒绝加载配置 → 系统无法启动。现场只能靠外部镜像手动关闭 secure boot 与 panicOnChecksumMismatch 才进入系统。

Read the full file on GitHub · 466 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 23d ago Changed · +137 lines · +27 tokens per session be1122f93801
  2. 29d ago Changed · +80 lines · +20 tokens per session 0df40a17078d
  3. 1mo ago First seen · 249 lines · 77 tokens per session scan A 1c4d658d620f

Subscribe to this mod's changes

nixos-specialisation-tuning is a skill published in the GitHub repository Kihara777/NixKits (28 stars, last pushed yesterday), licensed MIT. It adds 124 tokens to every session and 6,644 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

Other skills, from other repositories

moe-training

Train Mixture of Experts (MoE) models using DeepSpeed or HuggingFace. Use when training large-scale models with limited compute (5× cost reduction vs dense models), implementing sparse architectures like Mixtral 8x7B or DeepSeek-V3, or scaling model capacity without proportional compute increase. Covers MoE…

davila7/claude-code-templates · 85 tokens

clawrouter

Hosted-gateway LLM router — save 84% on inference costs. A local proxy that forwards each request to the blockrun.ai gateway, which routes to the cheapest capable model across 88 models from OpenAI, Anthropic, Google, DeepSeek, xAI, Z.AI, and more. 7 free open-weight models included. Also exposes realtime market data…

BlockRunAI/ClawRouter · 222 tokens

deepseek-helper

A guide for using the DeepSeek API, a service that lets programs send requests to DeepSeek language models. It covers model choice, example requests, prompt improvements, cost estimates, and common API errors.

dongsheng123132/u-claw · 25 tokens

ai4j-app-builder

Use this skill when helping users build applications with AI4J in their own Java or Spring Boot projects, including first chat, streaming, tool/function calls, MCP, RAG, memory, Agent runtime, Coding Agent CLI embedding, FlowGram integration, provider configuration, dependency selection, and troubleshooting. It guides…

LnYo-Cly/ai4j · 120 tokens

deepseek-harness

Use when building AI agent applications with a plugin-based architecture — Web UI, CLI, Python SDK, Cordis plugin system, multi-model orchestration. DeepSeek Harness (dsh): open-source agent harness by DeepSeek AI where everything is a plugin, powered by Cordis for spatiotemporal composability.

znlgis/opengis-skills · 68 tokens

vision-prep

An image and PDF preparation workflow for making small text and visual details easier for a vision model to read. A vision model is software that interprets images rather than plain text.

znlgis/my-opencode-deepseek-config · 94 tokens