Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
24 changes: 22 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,28 @@ By default, nix.dev builds without the various versions of the Nix reference man
To enable building the manuals:

```shell-session
[nix-shell:nix.dev]$ nix-build -A build --arg withManuals true
[nix-shell:nix.dev]$ devmode --arg withManuals true
$ nix-build -A build --arg withManuals true
```

Or for interactive development:

```shell-session
$ nix-shell --arg withManuals true --run devmode
```

## Building the PDF

By default, nix.dev is built without the PDF rendering, as that is takes too long for quick iteration on the contents.
Comment thread
fricklerhandwerk marked this conversation as resolved.
Outdated
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
Expand Down
20 changes: 13 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
inherit system;
},
withManuals ? false, # building the manuals is expensive
withPDF ? false, # building the PDF is expensive
}:
let
lib = pkgs.lib;
Expand Down Expand Up @@ -51,9 +52,9 @@ let
};
in
''
${lib.optionalString withManuals "cp -f ${substitutedNixManualReference} source/reference/nix-manual.md"}
cp -f ${substitutedNixManualReference} source/reference/nix-manual.md
make html
make latexpdf
${lib.optionalString withPDF "make latexpdf"}
'';
installPhase =
let
Expand All @@ -80,7 +81,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 @@ -89,10 +90,15 @@ let
'';
};

devmode = pkgs.devmode.override {
buildArgs = ''-A build --show-trace'';
open = "/index.html";
};
devmode =
let
boolean = x: if x then "true" else "false";
in

pkgs.devmode.override {
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 { };
update-nixpkgs-releases = pkgs.callPackage ./nix/update-nixpkgs-releases.nix { };
in
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(import ./. { }).shell
args@{ ... }: (import ./. args).shell
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