52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
gpgConfigFile = "gnupg/gpg.conf";
|
|
agentConfigFile = "gnupg/gpg-agent.conf";
|
|
in {
|
|
users.users.someone.packages = with pkgs; [
|
|
gnupg
|
|
pinentry-gnome3
|
|
];
|
|
|
|
xdg.configFile = {
|
|
"${gpgConfigFile}".text = ''
|
|
cert-digest-algo SHA512
|
|
charset utf-8
|
|
default-key 0F8835ED078FDBF2
|
|
default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed
|
|
fixed-list-mode
|
|
keyid-format 0xlong
|
|
list-options show-uid-validity
|
|
no-comments
|
|
no-emit-version
|
|
no-symkey-cache
|
|
personal-cipher-preferences AES256 AES192 AES
|
|
personal-compress-preferences ZLIB BZIP2 ZIP Uncompressed
|
|
personal-digest-preferences SHA512 SHA384 SHA256
|
|
require-cross-certification
|
|
s2k-cipher-algo AES256
|
|
s2k-digest-algo SHA512
|
|
use-agent
|
|
verify-options show-uid-validity
|
|
with-fingerprint
|
|
'';
|
|
"${agentConfigFile}".text = ''
|
|
enable-ssh-support
|
|
grab
|
|
pinentry-program ${pkgs.pinentry-gnome3}/bin/pinentry-curses
|
|
'';
|
|
"fish/conf.d/gpg.fish".source = pkgs.writeText "gpg.fish" ''
|
|
set -gx GPG_TTY (tty)
|
|
${pkgs.gnupg}/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null
|
|
'';
|
|
};
|
|
|
|
environment.sessionVariables = {
|
|
GPG_TTY = "$(tty)";
|
|
SSH_AUTH_SOCK = "${config.xdg.runtimeDir}/gnupg/S.gpg-agent.ssh";
|
|
};
|
|
}
|