diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 22990f0bf..c36eaa4b7 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Build run: | - nix-build --arg withManuals true + nix-build --arg withManuals true --arg withPDF true # The netlify action doesn't follow symlinks properly. mkdir ./dist diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6fcd7428..5054f9b75 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,21 @@ Or for interactive development: $ nix-shell --arg withManuals true --run devmode ``` +## Building the PDF + +By default, nix.dev is built without the PDF rendering, as that takes too long for quick iteration on the contents. +To enable building the PDF: + +```shell-session +$ nix-build -A build --arg withPDF true +``` + +Or for interactive development: + +```shell-session +$ nix-shell --arg withPDF true --run devmode +``` + ## Updating reference manuals With the current setup, the [Nix manual hosted on nix.dev](https://nix.dev/reference/nix-manual) does not get updated automatically with new releases. diff --git a/default.nix b/default.nix index ce2ed7994..0054582c0 100644 --- a/default.nix +++ b/default.nix @@ -7,7 +7,8 @@ inherit system; }, withManuals ? false, # building the manuals is expensive - inNixShell ? false # Provided by direnv-nix; Ignored for now. + inNixShell ? false, # Provided by direnv-nix; Ignored for now. + withPDF ? false, # building the PDF is expensive }: let lib = pkgs.lib; @@ -54,7 +55,7 @@ let '' cp -f ${substitutedNixManualReference} source/reference/nix-manual.md make html - make latexpdf + ${lib.optionalString withPDF "make latexpdf"} ''; installPhase = let @@ -81,7 +82,7 @@ let '' mkdir -p $out/manual/nix cp -R build/html/* $out/ - cp build/latex/nix-dev.pdf $out/ + ${lib.optionalString withPDF "cp build/latex/nix-dev.pdf $out/"} cp netlify.toml $out/ '' + lib.optionalString withManuals '' @@ -96,7 +97,7 @@ let in pkgs.devmode.override { - buildArgs = "-A build --show-trace --arg withManuals ${boolean withManuals}"; + buildArgs = "-A build --show-trace --arg withManuals ${boolean withManuals} --arg withPDF ${boolean withPDF}"; open = "/index.html"; }; update-nix-releases = pkgs.callPackage ./nix/update-nix-releases.nix { }; diff --git a/source/_templates/download-links.html b/source/_templates/download-links.html index e8f217923..ac74c4afe 100644 --- a/source/_templates/download-links.html +++ b/source/_templates/download-links.html @@ -1 +1 @@ -
nix.dev as PDF
+