From 58c9b6072205192497a56ca17a67c3fcd0a1a529 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 13 Mar 2021 00:01:29 +0000 Subject: [PATCH] home: gpg: make it enable-able --- home/gpg.nix | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/home/gpg.nix b/home/gpg.nix index e66b803..548f90b 100644 --- a/home/gpg.nix +++ b/home/gpg.nix @@ -1,15 +1,24 @@ -{ ... }: +{ config, lib, ... }: +let + cfg = config.my.home.gpg; +in { - programs.gpg = { - enable = true; + options.my.home.gpg = with lib.my; { + enable = mkDisableOption "gpg configuration"; }; - services.gpg-agent = { - enable = true; - enableSshSupport = true; # One agent to rule them all - pinentryFlavor = "tty"; - extraConfig = '' - allow-loopback-pinentry - ''; + config = lib.mkIf cfg.enable { + programs.gpg = { + enable = true; + }; + + services.gpg-agent = { + enable = true; + enableSshSupport = true; # One agent to rule them all + pinentryFlavor = "tty"; + extraConfig = '' + allow-loopback-pinentry + ''; + }; }; }