about summary refs log tree commit diff
path: root/src/nix/run.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r--src/nix/run.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 64a5cbd304d2..31c3c1464f1c 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -70,6 +70,24 @@ struct CmdRun : InstallablesCommand
         return "run a shell in which the specified packages are available";
     }
 
+    Examples examples() override
+    {
+        return {
+            Example{
+                "To start a shell providing GNU Hello from NixOS 17.03:",
+                "nix run -f channel:nixos-17.03 hello"
+            },
+            Example{
+                "To start a shell providing youtube-dl from your 'nixpkgs' channel:",
+                "nix run nixpkgs.youtube-dl"
+            },
+            Example{
+                "To run GNU Hello:",
+                "nix run nixpkgs.hello -c hello --greeting 'Hi everybody!'"
+            },
+        };
+    }
+
     void run(ref<Store> store) override
     {
         auto outPaths = toStorePaths(store, Build);