2 ms·
Regarding point 2, yes it's definitely a pain to mentally switch back-and-forth when writing shell code in a Nix string. Three things I find immensely helpful:
by chriswarbo 6y ago
Regarding point 2, yes it's definitely a pain to mentally switch back-and-forth when writing shell code in a Nix string.
Three things I find immensely helpful:
- Syntax highlighting (I use Emacs, which has a Nix mode)
- Syntax checking (again I use Emacs for this)
- Writing complicated scripts in a separate file. This makes it harder to splice in Nix values (there are ways to substitute in text, but I find them more trouble than they're worth). Setting some extra env vars in the build environment is usually the easiest approach.