aboutsummaryrefslogtreecommitdiff
path: root/home/gpg/default.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-08 08:30:17 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-08 08:30:17 -0700
commit2aa3e62136109c5c4762e951525d68aff3e1ac5a (patch)
tree0f508cad82717ac70c7da5fd402c9555ce9166d1 /home/gpg/default.nix
parenthome: fix for yt-dlp configuration (diff)
downloadinfra-2aa3e62136109c5c4762e951525d68aff3e1ac5a.tar.gz
home: add more configurations for home-manager
Diffstat (limited to 'home/gpg/default.nix')
-rw-r--r--home/gpg/default.nix33
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
+ '';
+ };
+ };
+}