nix-flake

Standardize flake.nix development with flake-parts, perSystem, and formatter conventions.

10|1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/juspay/AI --skill nix-flake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nix-flake
Source: https://github.com/juspay/AI/tree/main/.opencode/skills/nix-flake
Command: npx skills add https://github.com/juspay/AI --skill nix-flake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and editing flake.nix can be error-prone and repetitive; this skill provides a structured approach to use flake-parts, perSystem, and formatter conventions to standardize development workflows.

Core Features & Use Cases

  • Enforces perSystem outputs for packages, devShells, and checks to ensure architecture-wide consistency.
  • Encourages using a canonical formatter (pkgs.nixpkgs-fmt) and safe shell script patterns with meta.description annotations.
  • Supports scalable templates and conventions for language-specific flakes (Haskell, Rust, etc.) and nixos-unified-style workflows.

Quick Start

Edit your flake.nix using the nix-flake conventions and run nix flake commands to validate perSystem outputs.

Frequently Asked Questions about nix-flake

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

FAQPage Schema
How do I standardize perSystem outputs in a Nix flake?

To standardize perSystem outputs in a Nix flake, apply flake-parts conventions to structure per-system packages, devShells, and checks, ensuring architecture-wide consistency across your development workflow.

What is the best way to format a flake.nix file?

The best way to format a flake.nix file is by applying a canonical formatter like pkgs.nixpkgs-fmt, which standardizes code style and reduces formatting errors across your Nix flake configuration.

How do I structure a Nix flake for multiple architectures?

Structure a Nix flake for multiple architectures by using flake-parts to generate perSystem outputs, requiring strict metadata in each package or script to maintain consistency across different system families.

Does flake-parts work with language-specific Nix flakes?

Yes, flake-parts works with language-specific Nix flakes by providing scalable templates and conventions for languages like Haskell and Rust, alongside nixos-unified-style workflows for streamlined development.

Why do I need metadata descriptions in my Nix flake scripts?

You need metadata descriptions in your Nix flake scripts to enforce strict structural conventions, requiring a YAML frontmatter with a name and description to standardize safe shell script patterns across your project.

When should I use perSystem in a Nix flake instead of standard outputs?

Use perSystem in a Nix flake instead of standard outputs when you need to enforce architecture-wide consistency for packages and checks, ensuring your development workflow scales safely across different system families.