{ description = "GP markdown to PDF toolchain (Deno + Playwright + Chromium)"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils, }: flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] ( system: let pkgs = import nixpkgs { inherit system; }; lib = pkgs.lib; in { devShells.default = pkgs.mkShell { packages = [ pkgs.deno pkgs.nodejs_22 pkgs.qpdf ] ++ lib.optionals pkgs.stdenv.isLinux [ pkgs.chromium pkgs.noto-fonts-cjk-sans ]; PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1"; shellHook = '' export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 if [ -z "$CHROMIUM_PATH" ]; then if command -v chromium >/dev/null 2>&1; then export CHROMIUM_PATH="$(command -v chromium)" elif command -v chromium-browser >/dev/null 2>&1; then export CHROMIUM_PATH="$(command -v chromium-browser)" elif [ -x "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then export CHROMIUM_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" fi fi echo "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD" if [ -n "$CHROMIUM_PATH" ]; then echo "CHROMIUM_PATH=$CHROMIUM_PATH" else echo "CHROMIUM_PATH is not set." echo "Linux: add nixpkgs#chromium or install chromium system-wide." echo "macOS: install Google Chrome/Chromium and set CHROMIUM_PATH." fi ''; }; } ); }