Repository navigation
Add nix-run v2 command - #15662
Open
KiaraGrouwstra wants to merge 1 commit into
Open
Add nix-run v2 command#15662KiaraGrouwstra wants to merge 1 commit into
nix-run v2 command#15662KiaraGrouwstra wants to merge 1 commit into
Conversation
Adds a v1-CLI-style `nix-run` that evaluates a Nix expression and
executes the selected derivation's main program, using the same
`getExe`-like semantics as `nix run`: prefer `meta.mainProgram`, then
`pname`, then the parsed derivation name.
Usage:
nix-run [FILE] [-A ATTR] [-E] [-- ARGS...]
FILE defaults to `./default.nix`. Arguments after the first positional
(or after a literal `--`) are forwarded verbatim to the program.
KiaraGrouwstra
force-pushed
the
nix-run-cmd
branch
from
April 12, 2026 10:49
11a1df7 to
e604e58
Compare
Member
|
We definitely don't want to add new top-level commands. We've spent the last couple of years trying to replace If you want commands like |
Contributor
Author
right -- that's the idea behind #15654. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a v2-CLI-style
nix-runthat evaluates a Nix expression and executes the selected derivation's main program, using the samegetExe-like semantics asnix run: prefermeta.mainProgram, thenpname, then the parsed derivation name.Usage:
nix-run [FILE] [-A ATTR] [-E] [-- ARGS...]FILEdefaults to./default.nix. Arguments after the first positional (or after a literal--) are forwarded verbatim to the program.Motivation
inspired by #14992, tho with
fetchTree-powered source-fetching deferred to #15654.Context
disclaimer i used a coding agent in the creation of this patch.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.