Pandoc(omatic) and filters install/location issues

Since there is no functional pandoc-include (the original haskell one doesn’t build (too ancient?) and the python-based one needs pip which is also cumbersome in nix (as a system-wide solution anyway)), I try to use include-files.lua from pandoc-lua-filters, but installation doesn’t link to /current-system/sw/share as expected (why?), but I need to hard-code the lua file location in pandocomatic.yml.

I suppose the “preferred” way would be that the usual link is produced during nixos-rebuild, so I can just refer to /current-system/... How to achieve this?

While we’re at it: since there is no nix-package for pandocomatic I install it via gem install pandocomatic after which I manually have to fix the shebang to #!/usr/bin/env ruby instead of #! ruby.

So that looks that it would be best to package it myself?

Or is a more ideomatic way (“the nix way”) to define a nix-shell in my ~/.pandoc which includes the complete pandoc(omatic), texlive etc. environment, including shebang patching etc.?

Alternatively/additionally: what would be a good way to wrap a python pandoc filter (e.g. pandoc-xnos)? I suppose it must be possible to make an executable with #!/usr/bin/env nix-shell that acts the same (i.e. executes it under the hood) as said python module?

Ok, nevermind, the correct solution is to simply package the missing packages to nixpkgs, since that’s actually much easier than it seems due to the effective infrastructure of nix library functions…

Still one issue though: installing pandoc-lua-filters from configuration.nix doesn’t result in links to /run/current-system/sw/share/pandoc/filters/*.lua, but installing via home-manager does generate links to ~/.nix-profile/share/pandoc/filters/*.lua, why?

1 Like