nix-flake
Installation
SKILL.md
Nix Flake Development with flake-parts
All flakes use flake-parts with perSystem for per-architecture outputs.
Formatter
Always set formatter = pkgs.nixpkgs-fmt.
Shell scripts
Use pkgs.writeShellApplication (not writeShellScriptBin). It enables strict mode and validates runtimeInputs at build time. Always add meta.description.
Key conventions
- Keep
flake.nixminimal — delegate definitions to individual.nixfiles and import them. perSystemfor per-architecture outputs (packages, devShells, checks, formatter).flake(top-level) for arch-independent outputs (nixosConfigurations, lib, overlays).- Add
meta.descriptionto every package or script.