nixpkgs/pkgs/build-support/writers
DavHau 9a5b86c189 writers: add support for wrapping
Add a makeWrapperArgs argument to all script writers under pkgs.writers.

This can be used to set, prefix, or suffix the PATH or other environment variables which improves the ability to generate scripts with reproducible behavior.

Some of the writers (writeBash, writeDash, writeFish, writeNu) previously did not support passing an argument set, for example
```
writeBash "example" "echo hello"

```

In order to add the new capability to these writers as well, their call signature is now overloaded in order to allow the following:
(The old call style from the example above remains intact)
```
writeBash "example"
  { makeWrapperArgs = [ "--prefix" "PATH" ":" "${pkgs.hello}/bin" ]; }
  ''
    hello
  ''
```

Done as well:
- add tests
- add more docs
- fix some misleading docs
- extend existing docs with more examples
2024-03-05 14:25:42 +07:00
..
aliases.nix writers.writePython2: remove 2021-12-15 09:56:14 +01:00
data.nix doc: improve pkgs.writers comments 2024-02-29 10:38:03 +01:00
default.nix pkgs.writers: remove tests that dont work anymore and add comments tracking issues 2024-01-30 06:48:35 +01:00
scripts.nix writers: add support for wrapping 2024-03-05 14:25:42 +07:00
test.nix writers: add support for wrapping 2024-03-05 14:25:42 +07:00