about summary refs log tree commit diff
path: root/tests/run.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-11-20T17·36+0100
committerEelco Dolstra <edolstra@gmail.com>2017-11-20T17·36+0100
commit4cde04f476fa0f61680f8e53fe81cc70923689fc (patch)
treea30420970031575550981df402f965ec69d8d5cb /tests/run.nix
parentf5f29dc2b7c266875fb9cbb0c8d5cdde3ac4a73c (diff)
Add tests for "nix run"
Diffstat (limited to 'tests/run.nix')
-rw-r--r--tests/run.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run.nix b/tests/run.nix
new file mode 100644
index 0000000000..77dcbd2a9d
--- /dev/null
+++ b/tests/run.nix
@@ -0,0 +1,17 @@
+with import ./config.nix;
+
+{
+  hello = mkDerivation {
+    name = "hello";
+    buildCommand =
+      ''
+        mkdir -p $out/bin
+        cat > $out/bin/hello <<EOF
+        #! ${shell}
+        who=\$1
+        echo "Hello \''${who:-World} from $out/bin/hello"
+        EOF
+        chmod +x $out/bin/hello
+      '';
+  };
+}