From 03982a8e165cae2faf5d55319986de4af41c5b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Qui=C3=B1ones?= Date: Tue, 22 Aug 2023 08:56:24 -0600 Subject: [PATCH] nix3-run: add more examples (#10620) Co-authored-by: K.B.Dharun Krishna Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/common/nix3-run.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pages/common/nix3-run.md b/pages/common/nix3-run.md index 5fad773dc..cdc7cf8cc 100644 --- a/pages/common/nix3-run.md +++ b/pages/common/nix3-run.md @@ -4,10 +4,30 @@ > See `tldr nix3 flake` for information about flakes. > More information: . +- Run the default application in the flake in the current directory: + +`nix run` + - Run a command whose name matches the package name from nixpkgs (if you want a different command from that package, see `tldr nix3 shell`): `nix run nixpkgs#{{pkg}}` -- Run the default application in the flake in the current directory: +- Run a command with provided arguments: -`nix run` +`nix run nixpkgs#{{vim}} -- {{path/to/file}}` + +- Run from a remote repository: + +`nix run {{remote_name}}:{{owner}}/{{repo}}` + +- Run from a remote repository using a specific tag, revision or branch: + +`nix run {{remote_name}}:{{owner}}/{{repo}}/{{reference}}` + +- Run from a remote repository specifying a subdirectory and a program: + +`nix run "{{remote_name}}:{{owner}}/{{repo}}?dir={{dir_name}}#{{app}}"` + +- Run the flake of a GitHub pull request: + +`nix run github:{{owner}}/{{repo}}/pull/{{number}}/head`