Sometimes I bake Nix into my personal Makefiles.
This means that we lose the non-Nix build processes, but I get to keep the best of both worlds, and don't have to run `nix shell` or setup direnv.
"Uhm, actually" I use Guix, but the idea is the same:
SHELL = guix shell -m manifest.scm -- bash
public: hugo content
emacs $(pwd) --batch -l export.el
[...]
Or without an external manifest: SHELL = guix shell --pure bash coreutils emacs emacs-ox-hugo hugo -- bash
This is equivalent to the common shebang trick: #!/use/bin/env -S guix shell -m manifest.scm -- bash
Or just invoking Guix inside the recipe: public: hugo content
guix shell -m manifest.scm -- emacs $(pwd) --batch -l export.el
Depending on the complexity of `export.el` (< 5 lines?), I'll often keep that inside the Makefile too; the less files, the better!But I get it if one wants that file available to call from elsewhere.