nix3-run
executes packages without installing
TLDR
SYNOPSIS
nix run [options] [installable] [-- args...]
DESCRIPTION
nix3-run is the manual page for nix run, which builds (or downloads) an installable and runs it without installing it into a profile.If the installable is an app (a flake output with type = "app"), its program is executed. If it is a derivation, nix run executes out/bin/name, where name is the first of meta.mainProgram, pname, or the name part of name.
PARAMETERS
INSTALLABLE
Flake reference and output. Defaults to apps.<system>.default, then packages.<system>.default of the flake in the current directory.ARGS
Arguments passed to the program. Put them after -- so nix does not parse them.-i, --ignore-env
Clear the environment, except variables given with --keep-env-var.-k, --keep-env-var NAME
Keep the variable when using --ignore-env.-s, --set-env-var NAME VALUE
Set an environment variable.-u, --unset-env-var NAME
Unset an environment variable.--impure
Allow impure evaluation, e.g. to read NIXPKGSALLOWUNFREE.--help
Display help information.
INSTALL
CAVEATS
There is no nix3 executable: the new-CLI man pages are named nix3-subcommand. Use man nix3-run or nix run --help.Requires the nix-command experimental feature (and flakes for flake references). The first positional argument is always the installable, even after --, so write nix run . -- arg to pass arguments to the default app. The package stays in the store until the next garbage collection; network access is needed unless it is already cached.
HISTORY
In Nix 2.0-2.3, nix run started a shell with packages available; Nix 2.4 (2021) renamed that behavior to nix shell and made nix run execute a single app.
SEE ALSO
nix(1), nix-run(1), nix3-shell(1), nix-shell(1)
