diff --git a/pkgs/by-name/pa/pandoc/package.nix b/pkgs/by-name/pa/pandoc/package.nix index 3fd7ed8e9150..72faf5ec68f0 100644 --- a/pkgs/by-name/pa/pandoc/package.nix +++ b/pkgs/by-name/pa/pandoc/package.nix @@ -15,8 +15,6 @@ let in (haskell.lib.compose.overrideCabal (drv: { - configureFlags = drv.configureFlags or [ ] ++ [ "-fembed_data_files" ]; - buildDepends = drv.buildDepends or [ ] ++ [ pandoc-cli.scope.file-embed ]; buildTools = (drv.buildTools or [ ]) ++ [ removeReferencesTo installShellFiles diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 10a7bdd608e0..4496d6dbd0d9 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -347,6 +347,26 @@ builtins.intersectAttrs super { # Heist's test suite requires system pandoc heist = addTestToolDepend pkgs.pandoc super.heist; + pandoc = lib.pipe super.pandoc [ + # pandoc can't do I/O (including reading data files). See + # . + # It's simpler to just enable this globally rather than building multiple pandocs. + (enableCabalFlag "embed_data_files") + # pandoc still references these data files and we can't prevent their installation. + # pkgs.pandoc removes the reference to $out, so having everything in one place is best. + (overrideCabal { enableSeparateDataOutput = false; }) + ]; + + # So pandoc-server can be used: + # https://pandoc.org/MANUAL.html#running-pandoc-as-a-web-server + # TODO(@sternenseemann): provide pandoc-server.cgi symlink? + pandoc-cli = overrideCabal (drv: { + postInstall = '' + ${drv.postInstall or ""} + ln -s "''${!outputBin}/bin/pandoc" "''${!outputBin}/bin/pandoc-server" + ''; + }) super.pandoc-cli; + # Use Nixpkgs' double-conversion library double-conversion = disableCabalFlag "embedded_double_conversion" ( addBuildDepends [ pkgs.double-conversion ] super.double-conversion