diff options
author | Franck Cuny <franck@fcuny.net> | 2022-04-08 08:30:17 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-04-08 08:30:17 -0700 |
commit | 2aa3e62136109c5c4762e951525d68aff3e1ac5a (patch) | |
tree | 0f508cad82717ac70c7da5fd402c9555ce9166d1 /home/gpg | |
parent | home: fix for yt-dlp configuration (diff) | |
download | world-2aa3e62136109c5c4762e951525d68aff3e1ac5a.tar.gz |
home: add more configurations for home-manager
Diffstat (limited to 'home/gpg')
-rw-r--r-- | home/gpg/default.nix | 33 |
1 files changed, 33 insertions, 0 deletions
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 + ''; + }; + }; +} |