Skip to content

Commit c81d294

Browse files
make building the PDF optional
Iterating on contents takes way too much time otherwise.
1 parent b78816d commit c81d294

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Build
2525
run: |
26-
nix-build --arg withManuals true
26+
nix-build --arg withManuals true --arg withPDF true
2727
2828
# The netlify action doesn't follow symlinks properly.
2929
mkdir ./dist

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ To enable building the manuals:
3737
[nix-shell:nix.dev]$ devmode --arg withManuals true
3838
```
3939

40+
## Building the PDF
41+
42+
By default, nix.dev is built without the PDF rendering, as that is takes too long for quick iteration on the contents.
43+
To enable building the PDF:
44+
45+
```shell-session
46+
[nix-shell:nix.dev]$ nix-build -A build --arg withPDF true
47+
[nix-shell:nix.dev]$ devmode --arg withPDF true
48+
```
49+
4050
## Updating reference manuals
4151

4252
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.

default.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
inherit system;
88
},
99
withManuals ? false, # building the manuals is expensive
10+
withPDF ? false, # building the PDF is expensive
1011
}:
1112
let
1213
lib = pkgs.lib;
@@ -53,7 +54,7 @@ let
5354
''
5455
${lib.optionalString withManuals "cp -f ${substitutedNixManualReference} source/reference/nix-manual.md"}
5556
make html
56-
make latexpdf
57+
${lib.optionalString withPDF "make latexpdf"}
5758
'';
5859
installPhase =
5960
let
@@ -80,7 +81,7 @@ let
8081
''
8182
mkdir -p $out/manual/nix
8283
cp -R build/html/* $out/
83-
cp build/latex/nix-dev.pdf $out/
84+
${lib.optionalString withPDF "cp build/latex/nix-dev.pdf $out/"}
8485
cp netlify.toml $out/
8586
''
8687
+ lib.optionalString withManuals ''
@@ -90,7 +91,7 @@ let
9091
};
9192

9293
devmode = pkgs.devmode.override {
93-
buildArgs = ''-A build --show-trace'';
94+
buildArgs = "-A build --show-trace";
9495
open = "/index.html";
9596
};
9697
update-nix-releases = pkgs.callPackage ./nix/update-nix-releases.nix { };
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>nix.dev as <a href="/nix-dev.pdf">PDF</a></p>
1+
<p><a href="/nix-dev.pdf">nix.dev as PDF</a></p>

0 commit comments

Comments
 (0)