Skip to content

Commit

Permalink
feat(flake): Add a helper function to print to pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
etu committed Oct 13, 2024
1 parent d4aa6b5 commit b94106c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@
'';
};

buildPrintToPdf = {
builderDerivation,
format ? "A4",
}:
pkgs.writeShellApplication {
name = "print-to-pdf";
runtimeInputs = [
pkgs.puppeteer-cli
pkgs.nodePackages.live-server

# Include the desired builders program that cointains `resumed-render`
builderDerivation
];
text = ''
PORT=$(shuf -i 2000-65000 -n 1)
resumed-render
live-server --host=127.0.0.1 --port="$PORT" --wait=300 --no-browser &
puppeteer print "http://127.0.0.1:$PORT/resume.html" resume.pdf --format ${format}
exit 0
'';
};

buildThemeBuilder = themeName: let
themePkg = pkgs.callPackage ./themes/jsonresume-theme-${themeName} {};
in
Expand Down

0 comments on commit b94106c

Please sign in to comment.