query
On this page

writeDash

pkgs.writers.writeDash

Functor
Docs pulled from | This Revision | about 3 hours ago


Like writeScript but the first line is a shebang to dash

Can be called with or without extra arguments.

Example

pkgs.writers.writeDash example without arguments

writeDash "example" ''
  echo hello world
''

pkgs.writers.writeDash example with arguments

writeDash "example"
{
  makeWrapperArgs = [
    "--prefix" "PATH" ":" "${lib.makeBinPath [ pkgs.hello ]}"
  ];
}
''
  hello
''

Noogle detected

This is a Functor

Learn about functors

Implementation

The following is the current implementation of this function.

writeDash =
    name: argsOrScript:
    if lib.isAttrs argsOrScript && !lib.isDerivation argsOrScript then
      makeScriptWriter (argsOrScript // { interpreter = "${lib.getExe pkgs.dash}"; }) name
    else
      makeScriptWriter { interpreter = "${lib.getExe pkgs.dash}"; } name argsOrScript;