Skip to content

Commit 62d9144

Browse files
authored
Move post build hook headers down a layer (#1124)
All these `<h1>`s were semantically incorrect (they're part of the "Setting up post-build hooks" recipe), and they were messing up our recipe list by appearing as top level recipes on <https://nix.dev/guides/recipes/>.
1 parent 93b9f91 commit 62d9144

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/guides/recipes/post-build-hook.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The build loop exits if the hook program fails.
1313
Concretely, this implementation will make Nix slow or unusable when the network connection is slow or unreliable.
1414
A more advanced implementation might pass the store paths to a user-supplied daemon or queue for processing the store paths outside of the build loop.
1515

16-
# Prerequisites
16+
## Prerequisites
1717

1818
This tutorial assumes you have [configured an S3-compatible binary cache](https://nix.dev/manual/nix/2.22/store/types/s3-binary-cache-store#authenticated-writes-to-your-s3-compatible-binary-cache), and that the `root` user's default AWS profile can upload to the bucket.
1919

20-
# Set up a signing key
20+
## Set up a signing key
2121

2222
Use [`nix-store --generate-binary-cache-key`](https://nix.dev/manual/nix/2.22/command-ref/nix-store/generate-binary-cache-key) to create a pair of cryptographic keys.
2323
You will sign paths with the private key, and distribute the public key for verifying the authenticity of the paths.
@@ -43,7 +43,7 @@ The path to the file containing the private key you just generated must be added
4343
secret-key-files = /etc/nix/key.private
4444
```
4545

46-
# Implementing the build hook
46+
## Implementing the build hook
4747

4848
Write the following script to `/etc/nix/upload-to-cache.sh`:
4949

@@ -67,7 +67,7 @@ Make sure the hook program is executable by the `root` user:
6767
# chmod +x /etc/nix/upload-to-cache.sh
6868
```
6969

70-
# Updating nix configuration
70+
## Updating nix configuration
7171

7272
Set the [`post-build-hook`](https://nix.dev/manual/nix/2.22/command-ref/conf-file#conf-post-build-hook) configuration option on the local machine to run the hook:
7373

@@ -81,7 +81,7 @@ Then restart the `nix-daemon` an all involved machines, e.g. with
8181
pkill nix-daemon
8282
```
8383

84-
# Testing
84+
## Testing
8585

8686
Build any derivation, for example:
8787

@@ -107,7 +107,7 @@ warning: you did not specify '--add-root'; the result might be removed by the ga
107107
/nix/store/m8bmqwrch6l3h8s0k3d673xpmipcdpsa-example
108108
```
109109

110-
# Conclusion
110+
## Conclusion
111111

112112
You have configured Nix to automatically sign and upload every local build to a remote S3-compatible binary cache.
113113

0 commit comments

Comments
 (0)