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