Skip to content

Commit 18b4604

Browse files
stahnmazmitchell
authored andcommitted
Merge pull request #199 from flox/zmitchell/fix-trusted-key-instructions
fix: trusted key instructions
2 parents 8d781c7 + 8d845bd commit 18b4604

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

docs/cookbook/publish/signing-keys.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,30 @@ This amounts to adding the public key to the list of `extra-trusted-public-keys`
4141

4242
### Add a new trusted key
4343

44-
#### Nix installed via Flox
44+
#### Nix installed via Flox, or standalone Nix installation
4545

46-
If you installed Nix as part of your Flox installation, you need to create and/or edit your `$XDG_CONFIG_HOME/nix/nix.conf` file.
47-
On most systems this will be `~/.config/nix/nix.conf`.
48-
Add the following line, where `<key contents>` is the contents of the signing public key file:
46+
If you installed Nix as part of your Flox installation, you need to edit your `/etc/nix/nix.conf` to add a new entry to the `extra-trusted-public-keys` option.
47+
If `/etc/nix/nix.conf` doesn't exist, create it.
48+
If the `extra-trusted-public-keys` option doesn't exist, create it.
49+
Add the following line, where `<key contents>` is the contents of the signing public key file and `<existing keys>` is any keys that were already populated for this option (if it existed):
4950

5051
```text
51-
extra-trusted-public-keys = <key contents>
52+
extra-trusted-public-keys = <existing keys> <key contents>
5253
```
5354

54-
#### Existing Nix installation
55+
In order for the newly trusted key to take effect, the Nix daemon needs to be restarted.
56+
On Linux the daemon is managed via `systemd`, so you can restart it with the following command:
5557

56-
If you already have Nix installed, your instructions will look largely the same with the exception being that you can put this line in your `/etc/nix/nix.conf` instead if you so choose.
58+
```bash
59+
$ sudo systemctl restart nix-daemon
60+
```
61+
62+
On macOS the Nix daemon is managed via `launchd`, so you can restart it with the following command (note that you have to run the command twice, this is not a typo):
63+
64+
```bash
65+
sudo launchctl kickstart -k system/org.nixos.nix-daemon
66+
sudo launchctl kickstart -k system/org.nixos.nix-daemon
67+
```
5768

5869
#### NixOS, nix-darwin, or home-manager
5970

@@ -66,18 +77,4 @@ nix.settings.trusted-public-keys = [
6677
];
6778
```
6879

69-
### Restart the Nix daemon
70-
71-
In order for the newly trusted key to take effect, the Nix daemon needs to be restarted.
72-
On Linux the daemon is managed via `systemd`, so you can restart it with the following command:
73-
74-
```bash
75-
$ sudo systemctl restart nix-daemon
76-
```
77-
78-
On macOS the Nix daemon is managed via `launchd`, so you can restart it with the following command (note that you have to run the command twice, this is not a typo):
79-
80-
```bash
81-
sudo launctl kickstart -k system/org.nixos/nix-daemon
82-
sudo launctl kickstart -k system/org.nixos/nix-daemon
83-
```
80+
Once this setting has been edited, rebuild and switch into your new configuration.

0 commit comments

Comments
 (0)