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,-ttemplate β The template to use. pick your fighter π
π§ Common evaluation options π§
--argname expr β Pass the valueexpras the argumentnameto Nix functions.--arg-from-filename path β Pass the contents of filepathas the argumentnameto Nix functions.--arg-from-stdinname β Pass the contents of stdin as the argumentnameto Nix functions.--argstrname string β Pass the stringstringas the argumentnameto 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-storestore-url β The URL of the Nix store to use for evaluation, i.e. to store derivations (.drvfiles) and inputs referenced by them.--impureβ Allow access to mutable paths and repositories. messy but that's the point, bestie π--include,-Ipath β Addpathto 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-flakeoriginal-ref resolved-ref β Override the flake registries, redirectingoriginal-reftoresolved-ref.
π Logging-related options π
--debugβ Set the logging verbosity level todebug.--log-formatformat β Set the format of log output; one ofraw,internal-json,barorbar-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.--optionname value β Set the Nix configuration settingnametovalue(overridingnix.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
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms