nix-module-template

Generate NixOS, Home Manager, and nix-darwin module templates with separated options and config.

1|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/aytordev/system --skill nix-module-template-aytordev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nix-module-template
Source: https://github.com/aytordev/system/tree/main/modules/common/ai-tools/skills/nix/module-template
Command: npx skills add https://github.com/aytordev/system --skill nix-module-template-aytordev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Basic Nix module scaffolding to quickly create NixOS, Home Manager, or nix-darwin modules with a consistent structure.

Core Features & Use Cases

  • Standard structure: separate options declarations from configuration implementation, with usage guarded by an enable flag.
  • Pre-made templates for nixos, Home Manager, and nix-darwin modules to accelerate development.
  • Clear guidance for extending templates with project-specific defaults and example modules.

Quick Start

Copy this template into your module directory, rename placeholders, and adapt options and config to your project needs.

Frequently Asked Questions about nix-module-template

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a NixOS module with a standard structure separating options and config?▼

To create a NixOS module with standard structure, use a template that separates options declarations from configuration implementation and guards usage with an enable flag for consistent module scaffolding.

What is the standard structure for a Home Manager module?▼

The standard structure for a Home Manager module separates options declarations from configuration implementation, guarding usage with an enable flag to ensure consistent and predictable module behavior.

Can I use the same module skeleton for nix-darwin and NixOS?▼

Yes, you can use pre-made module skeletons for both nix-darwin and NixOS, as well as Home Manager, providing a consistent structure across different Nix-based system configurations.

How do I add an enable flag to my nix-darwin module?▼

To add an enable flag to your nix-darwin module, use a template that guards configuration implementation with an enable option, ensuring the config only applies when explicitly activated.

What's the best way to scaffold a Nix module quickly?▼

The best way to scaffold a Nix module quickly is to copy a pre-made template into your directory, rename placeholders, and adapt options and config to your project needs.

Why separate options and config in Nix modules?▼

Separating options and config in Nix modules enforces a standard structure, making modules maintainable and predictable by clearly distinguishing declarations from implementation guarded by an enable flag.