My attempt at organizing myself across machines via chezmoi.
This chezmoi configuration uses 1Password to manage secret injection.
To check whether or not a template is pulling secrets correctly, you can run a command like the following:
chezmoi execute-template "$(cat ./home/private_dot_config/exact_git/dot_gitconfig-work.tmpl)"To generate a new key, type: gpg --full-gen-key (alias: gpgcreate).
At the prompt, select the following:
- type
4for(4) RSA (sign only) - keysize:
4096 - expiration: choose something reasonable
To confirm the key was created, type: gpg --list-secret-keys --keyid-format SHORT (alias: gpglist)
If your GPG agent is having issues, you can restart it with:
gpgconf --kill gpg-agent
gpgconf --launch gpg-agent^ (alias: gpgrestart)
You can add multiple email addresses by doing the following:
- Edit the key:
gpg --edit-key 674CB45A(alias:gpgedit 674CB45A) - In gpg prompt, type
adduid; follow the prompts - Then, update the trust for the new identity:
uid 2andtrust; type5(for "I trust ultimately") - Type
save
To export the GPG key for use with something like GitHub or GitLab, type: gpg --armor --export 674CB45A (alias: gpgexport 674CB45A)