Misterio77 / nix-config

Personal nixos and home-manager configurations.
https://m7.rs/git/nix-config/
MIT License
719 stars 42 forks source link

help with configuring gpg #5

Closed luxus closed 1 year ago

luxus commented 1 year ago

hello, first i have to thanks for this awesome config. i had a on off relationship with nix and nixos and this config is the first complex config that was easy to understand. i still have a lot of knowledge gaps and i struggle to setup gnupg with your config. i mean i know how to generate keys but i still struggle to get it working :( how do you setup a new machine with your existing key?

Misterio77 commented 1 year ago

Hey!

Glad I could be of help somehow.

I currently use a yubikey for storing my key, but this should work with usual keys stored on disk too.

My most important gpg-related stuff are configured through home-manager. These are the minimum you have to set to get gpg working:

{
  services.gpg-agent = {
    enable = true;
    pinentryFlavor = "gtk2";
  };
  programs.gpg = {
    enable = true;
  };
}

And that's it! Pretty simple.

My own config is a little bit more complicated, because I also:

Misterio77 commented 1 year ago

Oh and I use gnome3 pinentry flavor instead of gtk2 as it looks nicer. I think you need to set (on NixOS, not home-manager) the option services.dbus.packages = [ pkgs.gcr ] for it to work.

luxus commented 1 year ago

great with your help i got everything working so far, even with your config. i imported my key by hand. i didn't knew that i can use a gpg key for ssh, that is working as well now. i should grab one of these yubikeys