You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/>.
Copy file name to clipboardExpand all lines: source/guides/recipes/post-build-hook.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,11 @@ The build loop exits if the hook program fails.
13
13
Concretely, this implementation will make Nix slow or unusable when the network connection is slow or unreliable.
14
14
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.
15
15
16
-
# Prerequisites
16
+
##Prerequisites
17
17
18
18
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.
19
19
20
-
# Set up a signing key
20
+
##Set up a signing key
21
21
22
22
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.
23
23
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
43
43
secret-key-files = /etc/nix/key.private
44
44
```
45
45
46
-
# Implementing the build hook
46
+
##Implementing the build hook
47
47
48
48
Write the following script to `/etc/nix/upload-to-cache.sh`:
49
49
@@ -67,7 +67,7 @@ Make sure the hook program is executable by the `root` user:
67
67
# chmod +x /etc/nix/upload-to-cache.sh
68
68
```
69
69
70
-
# Updating nix configuration
70
+
##Updating nix configuration
71
71
72
72
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:
73
73
@@ -81,7 +81,7 @@ Then restart the `nix-daemon` an all involved machines, e.g. with
81
81
pkill nix-daemon
82
82
```
83
83
84
-
# Testing
84
+
##Testing
85
85
86
86
Build any derivation, for example:
87
87
@@ -107,7 +107,7 @@ warning: you did not specify '--add-root'; the result might be removed by the ga
0 commit comments