nix3-edit(1)
โจ nix3-edit(1) โจ
okay bestie, welcome to the nix edit manual page ๐ this one lives in the General Commands Manual section, and it's giving โจpowerful but fragileโจ energy, so buckle up.
โ ๏ธ Warning โ this program is experimental and its interface is subject to change. no cap. it might glow up and change on you without warning, so don't get too attached to the exact vibes ๐
๐ธ Name ๐ธ
nix edit โ open the Nix expression of a Nix package in $EDITOR ๐ซถ
๐ Synopsis ๐
nix edit [optionโฆ] installable
๐ฆ Examples ๐ฆ
- Open the Nix expression of the GNU Hello package:
# nix edit nixpkgs#hello
- Get the filename and line number used by
nix edit:
# nix eval --raw nixpkgs#hello.meta.position
/nix/store/fvafw0gvwayzdan642wrv84pzm5bgpmy-source/pkgs/applications/misc/hello/default.nix:15
๐ Description ๐
so basically, this command opens the Nix expression of a derivation in an editor. the filename and line number of the derivation come from its meta.position attribute. and here's the tea: Nixpkgs' stdenv.mkDerivation sets this attribute to the location of the definition of the meta.description, version or name derivation attributes. iconic behaviour honestly ๐
the editor it invokes is specified by the EDITOR environment variable. it defaults to cat (yes, really, cat, it's just gonna dump the file at you ๐ฑ). and if the editor is emacs, nano, vim or kak, it gets passed the line number of the derivation using the argument +<lineno> โ so you land exactly on the right line. it's giving precision ๐
โจ Options โจ
๐งฎ Common evaluation options
--argname expr โ pass the value expr as the argument name to Nix functions.--arg-from-filename path โ pass the contents of file path as the argument name to Nix functions.--arg-from-stdinname โ pass the contents of stdin as the argument name to Nix functions.--argstrname string โ pass the string string as the argument name to Nix functions.--debuggerโ start an interactive environment if evaluation fails. so when it all goes wrong, you get a lil playground to poke at ๐ญ--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. living dangerously, love that for you ๐--include,-Ipath โ add path to search path entries used to resolve lookup paths.- This option may be given multiple times. (spam it, queen)
- Paths added through
-Itake precedence over thenix-pathconfiguration setting and theNIX_PATHenvironment variable. ๐
--override-flakeoriginal-ref resolved-ref โ override the flake registries, redirecting original-ref to resolved-ref.
๐ง Common flake-related options
--commit-lock-fileโ commit changes to the flake's lock file.--inputs-fromflake-url โ use the inputs of the specified flake as registry entries.--no-registriesโ don't allow lookups in the flake registries.
DEPRECATED โ use --no-use-registries instead.
--no-update-lock-fileโ do not allow any updates to the flake's lock file.--no-write-lock-fileโ do not write the flake's newly generated lock file.--output-lock-fileflake-lock-path โ write the given lock file instead offlake.lockwithin the top-level flake.--override-inputinput-path flake-url โ override a specific flake input (e.g.dwarffs/nixpkgs). the input path must not be empty. this implies--no-write-lock-file.--recreate-lock-fileโ recreate the flake's lock file from scratch.
DEPRECATED โ use nix flake update instead.
--reference-lock-fileflake-lock-path โ read the given lock file instead offlake.lockwithin the top-level flake.--update-inputinput-path โ update a specific flake input (ignoring its previous entry in the lock file).
DEPRECATED โ use nix flake update instead.
๐ Logging-related options
--debugโ set the logging verbosity level to โdebugโ.--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. shhh ๐คซ--verbose,-vโ increase the logging verbosity level. tell me everything ๐ฃ๏ธ
๐ 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 setting name to value (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.
๐ Options that change the interpretation of installables
--exprexpr โ interpret installables as attribute paths relative to the Nix expression expr.--file,-ffile โ interpret installables as attribute paths relative to the Nix expression stored in file. if file is the character-, then a Nix expression is read from standard input. implies--impure.
Note โ see man nix.conf for overriding configuration settings with command line flags.
and that's the whole page, bestie ๐ go forth and edit your Nix expressions like the main character you are. this was nix3-edit(1) from the General Commands Manual, signing off โ mwah ๐โจ
๐ฆ 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