Skyler Grey | 3bbe02b | 2022-07-24 10:40:38 +0100 | [diff] [blame] | 1 | { pkgs, ... }: let |
| 2 | pinentry-multiplexed = pkgs.writeScriptBin "pinentry-multiplexed" '' |
| 3 | case $PINENTRY_USER_DATA in |
| 4 | tty) |
| 5 | exec ${pkgs.pinentry.tty}/bin/pinentry "$@" |
| 6 | ;; |
| 7 | none) |
| 8 | exit 1 |
| 9 | ;; |
| 10 | *) |
| 11 | exec ${pkgs.pinentry.qt}/bin/pinentry "$@" |
| 12 | esac |
| 13 | ''; |
| 14 | in { |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 15 | programs.gpg.enable = true; |
| 16 | services.gpg-agent = { |
| 17 | enable = true; |
Skyler Grey | 3bbe02b | 2022-07-24 10:40:38 +0100 | [diff] [blame] | 18 | extraConfig = '' |
| 19 | pinentry-program ${pinentry-multiplexed}/bin/pinentry-multiplexed |
| 20 | ''; |
| 21 | pinentryFlavor = null; |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 22 | }; |
| 23 | |
Skyler Grey | 3bbe02b | 2022-07-24 10:40:38 +0100 | [diff] [blame] | 24 | home.packages = [ |
| 25 | pinentry-multiplexed |
Skyler Turner | 62330c1 | 2022-03-04 22:10:16 +0000 | [diff] [blame] | 26 | ]; |
Skyler Grey | 3bbe02b | 2022-07-24 10:40:38 +0100 | [diff] [blame] | 27 | } |