Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -54,7 +55,7 @@ let
''
cp -f ${substitutedNixManualReference} source/reference/nix-manual.md
make html
make latexpdf
${lib.optionalString withPDF "make latexpdf"}
'';
installPhase =
let
Expand All @@ -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 ''
Expand All @@ -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 { };
Expand Down
2 changes: 1 addition & 1 deletion source/_templates/download-links.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p>nix.dev as <a href="/nix-dev.pdf">PDF</a></p>
<p><a href="/nix-dev.pdf">nix.dev as PDF</a></p>
Loading