Back to skills
SKILL.md
Nix Patterns
ASecurityNixOS module patterns. Use when creating or editing NixOS/home-manager modules, adding packages, or configuring programs.
- 416 stars
- 0 votes
- 0 copies
- 12 views
- Added February 7, 2026
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add aiskillstore/marketplace --skill nix-patterns --agent claude-codeAre you the author of Nix Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/aiskillstore-nix-patterns)---
name: nix-patterns
description: NixOS module patterns. Use when creating or editing NixOS/home-manager modules, adding packages, or configuring programs.
---
# NixOS Module Patterns
## Directory structure
- `modules/home/*.nix` - Home-manager modules (user packages, dotfiles)
- `modules/nixos/*.nix` - NixOS modules (system services)
- `hosts/*/` - Machine-specific configuration
- `home/default.nix` - Main home-manager entry point
## Adding packages
```nix
home.packages = with pkgs; [
package-name
] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
x86-only-package
];
```
## Creating a module
```nix
{ pkgs, ... }:
{
home.packages = with pkgs; [ mypackage ];
xdg.configFile."app/config.json".text = builtins.toJSON { setting = "value"; };
}
```
Import in `home/default.nix`:
```nix
imports = [ ../modules/home/mymodule.nix ];
```
Files in this skill
- SKILL.md
- skill-report.json
Attribution
Comments
Loading comments…