From 2aa3e62136109c5c4762e951525d68aff3e1ac5a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 8 Apr 2022 08:30:17 -0700 Subject: home: add more configurations for home-manager --- home/gpg/default.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 home/gpg/default.nix (limited to 'home/gpg') diff --git a/home/gpg/default.nix b/home/gpg/default.nix new file mode 100644 index 0000000..d96c3aa --- /dev/null +++ b/home/gpg/default.nix @@ -0,0 +1,33 @@ +{ config, lib, ... }: +let cfg = config.my.home.gpg; +in { + options.my.home.gpg = with lib; { + enable = mkEnableOption "gpg configuration"; + pinentry = mkOption { + type = types.str; + default = "tty"; + example = "gnome3"; + description = "Which pinentry interface to use"; + }; + defaultKey = mkOption { + type = types.str; + default = null; + description = "Default GPG key"; + }; + }; + + config = lib.mkIf cfg.enable { + programs.gpg = { + enable = true; + settings = { default-key = cfg.defaultKey; }; + }; + services.gpg-agent = { + enable = true; + enableSshSupport = true; # One agent to rule them all + pinentryFlavor = cfg.pinentry; + extraConfig = '' + allow-loopback-pinentry + ''; + }; + }; +} -- cgit 1.4.1