2024-05-28 16:43:04 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2015-02-17 13:42:15 +00:00
|
|
|
source common.sh
|
|
|
|
|
2024-06-16 15:56:50 +00:00
|
|
|
clearStoreIfPossible
|
2015-02-17 13:42:15 +00:00
|
|
|
|
|
|
|
outPath=$(nix-build --no-out-link -E "
|
2024-11-01 13:56:50 +00:00
|
|
|
with import ${config_nix};
|
2015-02-17 13:42:15 +00:00
|
|
|
|
|
|
|
mkDerivation {
|
|
|
|
name = \"pass-as-file\";
|
|
|
|
passAsFile = [ \"foo\" ];
|
|
|
|
foo = [ \"xyzzy\" ];
|
|
|
|
builder = builtins.toFile \"builder.sh\" ''
|
2020-01-02 23:41:48 +00:00
|
|
|
[ \"\$(basename \$fooPath)\" = .attr-1bp7cri8hplaz6hbz0v4f0nl44rl84q1sg25kgwqzipzd1mv89ic ]
|
2015-02-17 15:42:54 +00:00
|
|
|
[ \"\$(cat \$fooPath)\" = xyzzy ]
|
2015-02-17 13:42:15 +00:00
|
|
|
touch \$out
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
")
|