with one click
nix-flake
// Use this when writing or editing a flake.nix. Covers flake-parts, perSystem, formatter, shell scripts, and package conventions.
// Use this when writing or editing a flake.nix. Covers flake-parts, perSystem, formatter, shell scripts, and package conventions.
| name | nix-flake |
| description | Use this when writing or editing a flake.nix. Covers flake-parts, perSystem, formatter, shell scripts, and package conventions. |
All flakes use flake-parts with perSystem for per-architecture outputs.
Always set formatter = pkgs.nixpkgs-fmt.
Use pkgs.writeShellApplication (not writeShellScriptBin). It enables strict mode and validates runtimeInputs at build time. Always add meta.description.
flake.nix minimal โ delegate definitions to individual .nix files and import them.perSystem for per-architecture outputs (packages, devShells, checks, formatter).flake (top-level) for arch-independent outputs (nixosConfigurations, lib, overlays).meta.description to every package or script.Use haskell-template. Key inputs: haskell-flake, nixos-unified, fourmolu-nix. The flake.nix delegates entirely to nixos-unified autowiring, which auto-imports ./nix/modules/flake/*.nix.
Use rust-nix-template. Key inputs: rust-flake, process-compose-flake. The flake.nix auto-imports all files under ./nix/modules/*.nix using builtins.readDir.
Use nixos-unified-template. Key inputs: home-manager, nix-darwin, nixos-unified. Also uses nixos-unified autowiring.
process-compose-flake: runs multi-process dev environments (backends, watchers, etc.) via process-compose integrated into a devShell.services-flake: built on top of process-compose-flake; provides ready-made service modules (PostgreSQL, Redis, etc.) for use in dev shells.Isolate tests in test/flake.nix to avoid polluting parent. No top-level flake needed โ test flake can reference parent content directly:
configDir = builtins.path { path = ./..; name = "config"; };
Use pkgs.testers.nixosTest for NixOS VM tests.