]> git.scottworley.com Git - paperdoorknob/blobdiff - default.nix
Contemplate generating LaTeX directly
[paperdoorknob] / default.nix
index f73efb59f4bf6c6e8cd558be53f76550a5eda24c..3e02638098eb34a7f513f1a3701a4c8a3cde5828 100644 (file)
@@ -1,17 +1,29 @@
 { pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage
-({ lib, buildPythonPackage, autopep8, mypy, pylint, }:
+pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, makeWrapper
+  , autopep8, mypy, pylint, beautifulsoup4, requests, requests-cache
+  , texliveBasic, types-beautifulsoup4, types-requests, xdg-base-dirs
+  , pandoc-cli }:
   buildPythonPackage rec {
     pname = "paperdoorknob";
     version = "0.0.1";
     src = lib.cleanSource ./.;
-    nativeCheckInputs = [ mypy ] ++ lib.optionals lint [ autopep8 pylint ];
+    nativeBuildInputs = [ makeWrapper ];
+    propagatedBuildInputs =
+      [ beautifulsoup4 requests requests-cache xdg-base-dirs ];
+    nativeCheckInputs =
+      [ mypy pandoc-cli texliveBasic types-beautifulsoup4 types-requests ]
+      ++ lib.optionals lint [ autopep8 pylint ];
     doCheck = true;
     checkPhase = "./test.sh";
+    postInstall = ''
+      wrapProgram "$out/bin/paperdoorknob" \
+        --add-flags "--pandoc=${pandoc-cli}/bin/pandoc" \
+
+    '';
     meta = {
       description = "A polite glowfic → printable book scraper.";
       homepage = "https://git.scottworley.com/paperdoorknob";
       license = pkgs.lib.licenses.gpl3;
       maintainers = with pkgs.lib.maintainers; [ chkno ];
     };
-  }) { }
+  }) { inherit (pkgs.haskellPackages) pandoc-cli; }