]> git.scottworley.com Git - paperdoorknob/blob - default.nix
Invoke pandoc to convert HTML to LaTeX
[paperdoorknob] / default.nix
1 { pkgs ? import <nixpkgs> { }, lint ? false }:
2 pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, makeWrapper
3 , autopep8, mypy, pylint, beautifulsoup4, requests, requests-cache
4 , types-beautifulsoup4, types-requests, xdg-base-dirs, pandoc-cli }:
5 buildPythonPackage rec {
6 pname = "paperdoorknob";
7 version = "0.0.1";
8 src = lib.cleanSource ./.;
9 nativeBuildInputs = [ makeWrapper ];
10 propagatedBuildInputs =
11 [ beautifulsoup4 requests requests-cache xdg-base-dirs ];
12 nativeCheckInputs = [ mypy pandoc-cli types-beautifulsoup4 types-requests ]
13 ++ lib.optionals lint [ autopep8 pylint ];
14 doCheck = true;
15 checkPhase = "./test.sh";
16 postInstall = ''
17 wrapProgram "$out/bin/paperdoorknob" \
18 --add-flags "--pandoc=${pandoc-cli}/bin/pandoc" \
19
20 '';
21 meta = {
22 description = "A polite glowfic → printable book scraper.";
23 homepage = "https://git.scottworley.com/paperdoorknob";
24 license = pkgs.lib.licenses.gpl3;
25 maintainers = with pkgs.lib.maintainers; [ chkno ];
26 };
27 }) { inherit (pkgs.haskellPackages) pandoc-cli; }