I am looking for a complimentary function to pkgs.writeShellScript, which I should expect to be named pkgs.runShellScript, which takes a derivation suffix (or the name of the script), and the contents of the script.
Well my example was multiline, and the script I intend to use is rather long. I could use heredoc to a bash interpreter, but I don’t know how well that would compose.
Does that mean you’re missing out of referencing nix values with nix interpolations? ${pkgs.hello}/bin/hello for example. I guess you could use import and call a nix file starting with ''.
Yes, but I don’t think that’s per-se an isse, since you can resolve those paths through runCommand's env variables if you need them.
For the record, I prefer multiline strings, or proper mkDerivations when scripts are too complex for those, but this seems to be what @spikespaz wants?
Their suggested function is the cleanest alternative if you want to have and eat all your cakes otherwise, and I don’t think there’s a better way to implement it (except maybe using writeShellApplication for nicer package resolution).