about summary refs log tree commit diff
path: root/third_party/nix/tests/pass-as-file.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/tests/pass-as-file.sh')
-rw-r--r--third_party/nix/tests/pass-as-file.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/third_party/nix/tests/pass-as-file.sh b/third_party/nix/tests/pass-as-file.sh
new file mode 100644
index 000000000000..3dfe10baa235
--- /dev/null
+++ b/third_party/nix/tests/pass-as-file.sh
@@ -0,0 +1,17 @@
+source common.sh
+
+clearStore
+
+outPath=$(nix-build --no-out-link -E "
+with import ./config.nix;
+
+mkDerivation {
+  name = \"pass-as-file\";
+  passAsFile = [ \"foo\" ];
+  foo = [ \"xyzzy\" ];
+  builder = builtins.toFile \"builder.sh\" ''
+    [ \"\$(cat \$fooPath)\" = xyzzy ]
+    touch \$out
+  '';
+}
+")