Skyler Grey | afb10f4 | 2022-08-26 06:55:48 +0100 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | username, |
| 4 | ... |
Skyler Grey | f48d308 | 2022-10-30 23:01:24 +0000 | [diff] [blame] | 5 | }: let |
| 6 | pinentry-multiplexed = pkgs.writeScriptBin "pinentry" '' |
| 7 | #if [[ $- == *i* ]] |
| 8 | #then |
| 9 | exec ${pkgs.pinentry.curses}/bin/pinentry "$@" |
| 10 | #else |
| 11 | # exec ${pkgs.pinentry.gnome3}/bin/pinentry "$@" |
| 12 | #fi |
| 13 | ''; |
| 14 | in { |
Skyler Grey | afb10f4 | 2022-08-26 06:55:48 +0100 | [diff] [blame] | 15 | home = { |
| 16 | programs.gpg.enable = true; |
| 17 | services.gpg-agent = { |
| 18 | enable = true; |
Skyler Grey | f48d308 | 2022-10-30 23:01:24 +0000 | [diff] [blame] | 19 | pinentryFlavor = "curses"; |
Skyler Grey | afb10f4 | 2022-08-26 06:55:48 +0100 | [diff] [blame] | 20 | }; |
| 21 | }; |
| 22 | |
| 23 | config.environment.persistence."/nix/persist".users.${username}.directories = [ |
| 24 | { |
| 25 | directory = ".gnupg"; |
| 26 | mode = "0700"; |
| 27 | } |
| 28 | ]; |
Skyler Grey | f48d308 | 2022-10-30 23:01:24 +0000 | [diff] [blame] | 29 | |
| 30 | home.home.packages = [ |
| 31 | pinentry-multiplexed |
| 32 | ]; |
Skyler Grey | afb10f4 | 2022-08-26 06:55:48 +0100 | [diff] [blame] | 33 | } |