Flakes Cheatsheet
Initialize a Flake
Section titled “Initialize a Flake”Create a new directory, or cd into an existing project directory that you want to convert into a flake.
Initialize using a template:
nix flake init -t github:akirak/flake-templates#flake-utilsYou can also initialize with the default template:
nix flake initList Available Flake Templates
Section titled “List Available Flake Templates”List templates from the built-in registry:
nix flake show templatesYou can also inspect templates from any flake:
nix flake show github:akirak/flake-templatesInspect a Flake’s Outputs
Section titled “Inspect a Flake’s Outputs”To see what a flake provides (packages, devShells, apps, etc.):
nix flake showTo inspect a specific flake:
nix flake show github:NixOS/nixpkgsFlake Input URL Syntax Reference
Section titled “Flake Input URL Syntax Reference”Flake inputs support several URL-like syntaxes (GitHub, Git, local paths, tarballs, etc.).
Official reference:
https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake#url-like-syntax