nix3-run(1)
β¨ nix3-run(1) β go run a Nix application, bestie β¨
hiiii so this is nix3-run(1) from the General Commands Manual, and it's literally the page that tells you how to make Nix go zoom and actually launch stuff. it's giving "cheat code for nix run" and honestly? iconic. π
β οΈ Warning β οΈ This program is experimental and its interface is subject to change. like, fr fr, the interface will change under your feet, so don't build your entire personality around it. π
π Name
nix run β run a Nix application
π Synopsis
nix run [optionβ¦] installable argsβ¦
πΈ Examples
- Run the default app from the
blender-binflake:
# nix run blender-bin
- Run a non-default app from the
blender-binflake:
# nix run blender-bin#blender_2_83
π«Ά Tip: you can find apps provided by this flake by running nix flake show blender-bin.
- Run
vimfrom thenixpkgsflake:
# nix run nixpkgs#vim
π Note thatvim(as of the time of writing of this page) is not an app but a package. Thus, Nix runs the eponymous file from thevimpackage.
- Run
vimwith arguments:
# nix run nixpkgs#vim -- --help
- Run the default app from the current directory with arguments:
# nix run . -- arg1 arg2
π Note: The first positional argument is always treated as the installable, even after--. To pass arguments to the default installable, specify it explicitly:nix run . -- arg1 arg2ornix run -- . arg1 arg2.
π¦ Description
nix run builds and runs installable, which must evaluate to an app or a regular Nix derivation.
If installable evaluates to an app (see below), it executes the program specified by the app definition.
If installable evaluates to a derivation, it will try to execute the program <out>/bin/<name>, where out is the primary output store path of the derivation, and name is the first of the following that exists:
- The
meta.mainProgramattribute of the derivation. - The
pnameattribute of the derivation. - The
namepart of the value of thenameattribute of the derivation.
For instance, if name is set to hello-1.10, nix run will run $out/bin/hello. β¨
π Flake output attributes
If no flake output attribute is given, nix run tries the following flake output attributes:
apps.<system>.defaultpackages.<system>.default
If an attribute name is given, nix run tries the following flake output attributes:
apps.<system>.<name>packages.<system>.<name>legacyPackages.<system>.<name>
π Apps
An app is specified by a flake output attribute named apps.<system>.<name>. It looks like this:
apps.x86_64-linux.blender_2_79 = {
type = "app";
program = "${self.packages.x86_64-linux.blender_2_79}/bin/blender";
meta.description = "Run Blender, a free and open-source 3D creation suite.";
};
The only supported attributes are:
type(required): Must be set toapp.program(required): The full path of the executable to run. It must reside in the Nix store.meta.description(optional): A description of the app.
β¨ Options β¨
π§ 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. (your lil debugging era π«Ά)--eval-store store-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.--include / -I pathβ Add path to search path entries used to resolve lookup paths.
This option may be given multiple times. (stack 'em up π )
Paths added through -I take precedence over the nix-path configuration setting and the NIX_PATH environment variable.
--override-flake original-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-from flake-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-file flake-lock-pathβ Write the given lock file instead offlake.lockwithin the top-level flake.--override-input input-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-file flake-lock-pathβ Read the given lock file instead offlake.lockwithin the top-level flake.--update-input input-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-format formatβ 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.--option name 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 environment variables
--ignore-env / -iβ Clear the entire environment, except for those specified with--keep-env-var.--keep-env-var / -k nameβ Keep the environment variable name, when using--ignore-env.--set-env-var / -s name valueβ Sets an environment variable name with value.--unset-env-var / -u nameβ Unset the environment variable name.
π§ Options that change the interpretation of installables
--expr exprβ Interpret installables as attribute paths relative to the Nix expression expr.--file / -f fileβ 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.
aaaand that's the whole page, bestie, you ate that π the footer says nix3-run(1) β it's the nix3-run(1) page from the General Commands Manual, so like, that's the manual name and the version-of-record right there. now go run something cute. ππ¦β¨
π¦ 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