From 39dcd30b9e9728851c378844ef0e68fb644d1763 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 22 Oct 2024 00:24:36 +0300 Subject: [PATCH] Gpg: Add gpg_find to locate keys. --- home/program/bash/module/Gpg.nix | 14 ++++++++++++++ home/program/default.nix | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/home/program/bash/module/Gpg.nix b/home/program/bash/module/Gpg.nix index beb8d67..ed899c5 100644 --- a/home/program/bash/module/Gpg.nix +++ b/home/program/bash/module/Gpg.nix @@ -73,5 +73,19 @@ _iterate_targets process ''${targets[@]} } + + # Find user keys using keyservers. + # Usage: gpg_find + function gpg_find() { + local email="''${1}" + + if [[ "''${email}" = "" ]]; then + help gpg_find + return 2 + fi + + gpg --locate-keys "''${email}" \ + || gpg --locate-keys --auto-key-locate hkps://keys.openpgp.org "''${email}" + } ''; } diff --git a/home/program/default.nix b/home/program/default.nix index 0c0533e..8ec1fb8 100644 --- a/home/program/default.nix +++ b/home/program/default.nix @@ -8,6 +8,11 @@ in gpg = { enable = true; inherit (secret.crypto) publicKeys; + mutableKeys = true; + mutableTrust = true; + settings = { + keyserver = "hkps://keys.openpgp.org"; + }; }; firefox = import ./firefox args;