about summary refs log blame commit diff stats
path: root/home-manager/config/gpg/default.nix
blob: feba1298af585fd0149d6394e8288e651a228253 (plain) (tree)
1
2
3
4
5
6
7
8
9
         
         
       
      
                                                      
                               
                          




                               

                                                     
                         
                                        
                                                               

                                                 



                                        


                                            
      


           
{
  config,
  sysLib,
  pkgs,
  ...
}: let
  agent-program = sysLib.writeShellScriptWithLibrary {
    name = "onlykey-gpg-agent";
    src = ./agent-program;
    dependencies = with pkgs; [
      python3
      onlykey-agent
    ];
  };
in {
  programs.gpg = {
    enable = true;
    homedir = "${config.xdg.dataHome}/gnupg/onlykey";
    mutableKeys = false;
    mutableTrust = false;
    settings = {
      # Hardware-based GPG configuration
      agent-program = "${agent-program}/bin/onlykey-gpg-agent";

      default-key = "Soispha <soispha@vhack.eu>";
      # TODO add more
    };
    publicKeys = [
      {
        source = ./keys/sils_at_sils.li;
        trust = "full";
      }
      {
        source = ./keys/soispha_at_vhack.eu;
        trust = "ultimate";
      }
    ];
  };
}
# vim: ts=2