GPG
This module sets some defaults for gpg, mainly to let your gpg-agent handle ssh keys.
View the nix-core Home Manager module on GitHub.
SSH Setup
GPG
You need a GPG authentication subkey. Follow the steps below to create one. If you already have a GPG key, skip to step 2.
1. Generate a new GPG key
- Select
1
as the type of key. - Select
4096
for the keysize. - Select
0
to choose 'Never expire'. - Enter your name, email address, and a comment (if you want). Select
0
for 'Okay'.
2. Create an authentication subkey
- At the new
gpg>
prompt, enter:addkey
- When prompted, enter your passphrase.
- When asked for the type of key you want, select: (8) RSA (set your own capabilities).
- Enter
S
to toggle the ‘Sign’ action off. - Enter
E
to toggle the ‘Encrypt’ action off. - Enter
A
to toggle the ‘Authenticate’ action on. The output should now include Current allowed actions: Authenticate, with nothing else on that line. - Enter
Q
to continue. - When asked for a keysize, choose
4096
. - Select
0
to choose 'Never expire'. - Once the key is created, enter
quit
to leave the gpg prompt, andy
at the prompt to save changes.
HM config
imports = [
inputs.core.homeModules.gpg
];
services.gpg-agent.sshKeys = [ "YOUR_AUTH_SUBKEY_KEYGRIP" ];
Get the keygrip of your authentication subkey with:
gpg -K --with-keygrip