Marketplace nix-patterns
NixOS module patterns. Use when creating or editing NixOS/home-manager modules, adding packages, or configuring programs.
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/edgarpost/nix-patterns" ~/.claude/skills/aiskillstore-marketplace-nix-patterns && rm -rf "$T"
manifest:
skills/edgarpost/nix-patterns/SKILL.mdsource content
NixOS Module Patterns
Directory structure
- Home-manager modules (user packages, dotfiles)modules/home/*.nix
- NixOS modules (system services)modules/nixos/*.nix
- Machine-specific configurationhosts/*/
- Main home-manager entry pointhome/default.nix
Adding packages
home.packages = with pkgs; [ package-name ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ x86-only-package ];
Creating a module
{ pkgs, ... }: { home.packages = with pkgs; [ mypackage ]; xdg.configFile."app/config.json".text = builtins.toJSON { setting = "value"; }; }
Import in
home/default.nix:
imports = [ ../modules/home/mymodule.nix ];