2020-09-30 03:42:59 +00:00
|
|
|
{ pkgs, depot, ... }:
|
|
|
|
|
|
|
|
# Write the given string to $out
|
|
|
|
# and make it executable.
|
|
|
|
|
|
|
|
let
|
|
|
|
bins = depot.nix.getBins pkgs.s6-portable-utils [
|
2022-05-19 14:39:52 +00:00
|
|
|
"s6-cat"
|
|
|
|
"s6-chmod"
|
|
|
|
];
|
2020-09-30 03:42:59 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
name:
|
|
|
|
# string of the executable script that is put in $out
|
|
|
|
script:
|
|
|
|
|
2022-05-19 14:39:52 +00:00
|
|
|
depot.nix.runExecline name
|
|
|
|
{
|
2020-09-30 03:42:59 +00:00
|
|
|
stdin = script;
|
|
|
|
derivationArgs = {
|
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
|
|
|
};
|
|
|
|
} [
|
2022-05-19 14:39:52 +00:00
|
|
|
"importas"
|
|
|
|
"out"
|
|
|
|
"out"
|
2020-09-30 03:42:59 +00:00
|
|
|
# this pipes stdout of s6-cat to $out
|
|
|
|
# and s6-cat redirects from stdin to stdout
|
2022-05-19 14:39:52 +00:00
|
|
|
"if"
|
|
|
|
[ "redirfd" "-w" "1" "$out" bins.s6-cat ]
|
|
|
|
bins.s6-chmod
|
|
|
|
"0755"
|
|
|
|
"$out"
|
2020-09-30 03:42:59 +00:00
|
|
|
]
|