git.iko.soy/typeable/nixpkgs
on master help sign in
programs.gnupg: Support setting the gnupg package
commitc0deb007fcf1e898203ca8a51b8d6e6bf66e71de authorBastian Köcher <git@kchr.de> dateSun 17 Mar 2019, 09:49 (8 years ago) parent9b3da9e
1 file changed+12−3
nixos/modules/programs/gnupg.nix+12−3
nixos/modules/programs/gnupg.nix+12−3
@@ -11,6 +11,15 @@ in
1111{
1212
1313 options.programs.gnupg = {
14+ package = mkOption {
15+ type = types.package;
16+ default = pkgs.gnupg;
17+ defaultText = "pkgs.gnupg";
18+ description = ''
19+ The gpg package that should be used.
20+ '';
21+ };
22+
1423 agent.enable = mkOption {
1524 type = types.bool;
1625 default = false;
@@ -75,7 +84,7 @@ in
7584 wantedBy = [ "sockets.target" ];
7685 };
7786
78− systemd.packages = [ pkgs.gnupg ];
87+ systemd.packages = [ cfg.package ];
7988
8089 environment.interactiveShellInit = ''
8190 # Bind gpg-agent to this TTY if gpg commands are used.
@@ -84,12 +93,12 @@ in
8493 '' + (optionalString cfg.agent.enableSSHSupport ''
8594 # SSH agent protocol doesn't support changing TTYs, so bind the agent
8695 # to every new TTY.
87− ${pkgs.gnupg}/bin/gpg-connect-agent --quiet updatestartuptty /bye > /dev/null
96+ ${cfg.package}/bin/gpg-connect-agent --quiet updatestartuptty /bye > /dev/null
8897 '');
8998
9099 environment.extraInit = mkIf cfg.agent.enableSSHSupport ''
91100 if [ -z "$SSH_AUTH_SOCK" ]; then
92− export SSH_AUTH_SOCK=$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)
101+ export SSH_AUTH_SOCK=$(${cfg.package}/bin/gpgconf --list-dirs agent-ssh-socket)
93102 fi
94103 '';
95104