# Build NixOS Modules with Home Manager Patterns

NixOS and Home Manager module setup can be repetitive and error-prone. This skill gives concise patterns for packages, modules, and imports.

## Install

```bash
npx skillstore add edgarpost/nix-patterns
```

## Metadata

- Status: approved
- Slug: edgarpost-nix-patterns
- Skillstore revision: r1
- Version status: missing
- Tree hash: f8a0f1f95e2bd18248f5fe470db97b1d77bb3726b3ad3ed4752475006c976750
- Author: EdgarPost
- GitHub username: EdgarPost
- License: MIT
- Repository: https://github.com/EdgarPost/claude-code/tree/main/skills/nix
- Ref: 72d5025b022c77f7a51bdf5c1637c689c80e89d1
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, filesystem
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/edgarpost-nix-patterns
- Manifest: https://skillstore.pages.dev/api/skills/edgarpost-nix-patterns/manifest

## Capabilities

- Shows standard directories for Home Manager modules, NixOS modules, hosts, and the home entry point.
- Provides a package list pattern using pkgs, lib.optionals, and platform checks.
- Provides a simple Home Manager module skeleton with package and config file examples.
- Shows how to import a Home Manager module from home/default.nix.
- Helps keep Nix configuration examples short and consistent.

## Use Cases

- Create a Home Manager Module: Draft a small module that adds packages and writes user configuration files.
- Organize System Configuration: Place NixOS modules, Home Manager modules, and host files in predictable directories.
- Review Package Patterns: Check whether package additions use clear lists and platform-specific conditionals.

## Prompt Templates

### Add User Packages

```
Use the nix-patterns skill to add these Home Manager packages: [packages]. Keep the module structure simple.
```

### Create a Small Module

```
Use the nix-patterns skill to draft a Home Manager module for [program]. Include packages and one configuration file.
```

### Add Platform Conditions

```
Use the nix-patterns skill to add [package] only on x86_64-linux while keeping shared packages available everywhere.
```

### Refactor Module Layout

```
Use the nix-patterns skill to reorganize this Nix configuration into home modules, NixOS modules, host files, and imports.
```

## Limitations

- Covers concise module patterns, not a full NixOS architecture guide.
- Does not include flake setup, lock file maintenance, or channel management.
- Does not run Nix evaluation, formatting, or rebuild commands.
- Does not cover secret management or complex service hardening.

## Best Practices

- Keep Home Manager modules focused on user packages and user configuration files.
- Use platform conditionals when a package is only valid for one system type.
- Import modules from a clear entry point so configuration flow stays easy to review.

## Anti Patterns

- Mixing host-specific settings into reusable Home Manager modules.
- Adding platform-specific packages to shared package lists without conditionals.
- Creating modules without adding them to the appropriate import list.

## Security Audit

- Audited at: 2026-07-06T11:47:37.949\+00:00
- Summary: All command-execution findings are Markdown backticks used for inline paths or fenced Nix examples, not executable code. The traversal finding is a normal relative Nix import example and does not process user input. No prompt injection or malicious intent was found in SKILL.md.

## Stats

- Views: 182
- Downloads: 6
- Favorites: 0
- Popularity score: 0
