blob: fd9719cf3a597a275685215521de3360e4e6a796 [file] [log] [blame]
Skyler Greyafb10f42022-08-26 06:55:48 +01001{
2 pkgs,
3 username,
4 ...
Skyler Greyf48d3082022-10-30 23:01:24 +00005}: 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 '';
14in {
Skyler Greyafb10f42022-08-26 06:55:48 +010015 home = {
16 programs.gpg.enable = true;
17 services.gpg-agent = {
18 enable = true;
Skyler Greyf48d3082022-10-30 23:01:24 +000019 pinentryFlavor = "curses";
Skyler Greyafb10f42022-08-26 06:55:48 +010020 };
21 };
22
23 config.environment.persistence."/nix/persist".users.${username}.directories = [
24 {
25 directory = ".gnupg";
26 mode = "0700";
27 }
28 ];
Skyler Greyf48d3082022-10-30 23:01:24 +000029
30 home.home.packages = [
31 pinentry-multiplexed
32 ];
Skyler Greyafb10f42022-08-26 06:55:48 +010033}