nix3-flake-new(1)

πŸ’– nix flake new πŸ’–

okay bestie, welcome to the nix3-flake-new(1) page from the General Commands Manual β€” yes it's a manual-page situation, but make it cute. This is the one that spawns a whole fresh flake in an empty directory like it's no big deal. πŸ¦‹

⚠️ Warning This program is experimental and its interface is subject to change. Translation: the vibes are immaculate but the flag names might ghost you in a future release. Proceed with main character energy and a backup of your scripts. πŸ’€

✨ Name ✨

nix flake new β€” create a flake in the specified directory from a template 🌸

Basically: you point at a directory that does not exist yet, and it births a flake in there. Iconic behaviour honestly.


πŸ“œ Synopsis πŸ“œ

nix flake new [option…] dest-dir

🌈 Examples 🌈

okay so here's the group chat receipts:

  • Create a flake using the default template in the directory hello:
# nix flake new hello
  • List available templates:
# nix flake show templates
  • Create a flake from a specific template in the directory hello:
# nix flake new hello -t templates#trivial

see how easy that was? no cap. 🫢


πŸ’… Description πŸ’…

This command creates a flake in the directory dest-dir, which must not already exist. the way it refuses to touch a directory that's already there? that's the boundary-setting we love. πŸ‘‘

It's equivalent to:

# mkdir dest-dir
# cd dest-dir
# nix flake init

so like... it's literally just doing those three things for you, which is giving "little sister copying your homework but correctly." πŸŽ€


⭐ Options ⭐

  • --template, -t template β€” The template to use. pick your fighter πŸ’–

🧚 Common evaluation options 🧚

  • --arg name expr β€” Pass the value expr as the argument name to Nix functions.
  • --arg-from-file name path β€” Pass the contents of file path as the argument name to Nix functions.
  • --arg-from-stdin name β€” Pass the contents of stdin as the argument name to Nix functions.
  • --argstr name string β€” Pass the string string as the argument name to Nix functions.
  • --debugger β€” Start an interactive environment if evaluation fails. it's giving "when it all goes wrong, at least you get a lil REPL to cry in." 😭
  • --eval-store store-url β€” The URL of the Nix store to use for evaluation, i.e. to store derivations (.drv files) and inputs referenced by them.
  • --impure β€” Allow access to mutable paths and repositories. messy but that's the point, bestie πŸ™ˆ
  • --include, -I path β€” Add path to search path entries used to resolve lookup paths.

This option may be given multiple times.

Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable. so -I is the loudest one in the room, and it wins. πŸ”₯

  • --override-flake original-ref resolved-ref β€” Override the flake registries, redirecting original-ref to resolved-ref.
  • --debug β€” Set the logging verbosity level to debug.
  • --log-format format β€” Set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs, -L β€” Print full build logs on standard error.
  • --quiet β€” Decrease the logging verbosity level.
  • --verbose, -v β€” Increase the logging verbosity level.

πŸ‘‘ Miscellaneous global options πŸ‘‘

  • --help β€” Show usage information.
  • --offline β€” Disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” Set the Nix configuration setting name to value (overriding nix.conf).
  • --refresh β€” Consider all previously downloaded files out-of-date.
  • --repair β€” During evaluation, rewrite missing or corrupted files in the Nix store. During building, rebuild missing or corrupted store paths.
  • --version β€” Show version information.
πŸ“ Note See man nix.conf for overriding configuration settings with command line flags.

and that's the whole page babe, every single flag accounted for, nothing skipped, periodt. πŸ’œ

sign-off time πŸ¦‹βœ¨ this whole thing lives in the nix3-flake-new(1) corner of the manual, and the footer just whispers nix3-flake-new(1) right back at you β€” no date, no version number, just the page name holding it down at the bottom of the terminal. it's giving mysterious. it's giving minimal. we love that for it. πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from