pandoc
pandoc copied to clipboard
WIP: Create a working `flake.nix`
- [x] Bootstrap
flake.nixbased on haskell-flake, overriding dependencies - [ ]
nix buildto work - [ ] devShell (
nix develop) to work - [ ] HLS to work
- [ ] Upstream
skylightingNix - [ ] How should Nix package deal with cabal flags?
Got all the dependencies building, as well as the pandoc sources to build, but the installPhase is failing:
$ nix build -L
...
pandoc> Running phase: installPhase
pandoc> Installing internal library xml-light in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-5gNPAzSbfOpCcG9wr5Jih8-xml-light
pandoc> Installing library in /nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/lib/ghc-9.6.5/lib/aarch64-osx-ghc-9.6.5/pandoc-3.2.1-Cyanjkwa9raImcHGQJDkHy
pandoc> mv: missing destination file operand after '/nix/store/6hj2lf84wl10hqmymp8xz9m772g6hdw6-pandoc-3.2.1/share/man/man1/'
pandoc> Try 'mv --help' for more information.
pandoc> /nix/store/ashgigyp2dkvfi1spyl9nsnirvbk67vh-stdenv-darwin/setup: line 140: pop_var_context: head of shell_variables not a function context
This feel closer to the goal than where it started, but without a working installPhase even nix run isn't usable on the flake. It looks like the trouble is with moving the man page to the right destination. Where is that command coming from?
It is probably something to do with this:
https://github.com/jgm/pandoc/blob/2f36df65e6b8aa9b12551b3773d55a855c24a03d/pandoc-cli/pandoc-cli.cabal#L17-L21
And how https://github.com/NixOS/cabal2nix (which haskell-flake, via nixpkgs, uses) handles it.
Perhaps use one of the early (postUnpack?) stages to patch that out of the sources and see what happens?