feat: add gnupg module

This commit is contained in:
Dmitriy Kholkin 2025-06-07 21:12:13 +03:00
parent 43d4b8ab04
commit d4f31a9ca8
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
2 changed files with 43 additions and 0 deletions

View File

@ -37,6 +37,7 @@ in
config =
let
baseRole = {
ataraxia.defaults.gpg.enable = mkDefault true;
ataraxia.defaults.zsh.enable = mkDefault true;
ataraxia.security.pass-secret-service.enable = mkDefault true;
ataraxia.security.password-store.enable = mkDefault true;

View File

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.ataraxia.defaults.gpg;
in
{
options.ataraxia.defaults.gpg = {
enable = mkEnableOption "Default gpg settings";
};
config = mkIf cfg.enable {
programs.gpg = {
enable = true;
homedir = "${config.xdg.dataHome}/gnupg";
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentry.package = pkgs.pinentry-gnome3;
sshKeys = [
"7A7130ABF128CC2C32B3D6AD27515056B0193CE1"
"E6A6377C3D0827C36428A290199FDB3B91414AFE"
];
};
systemd.user.services.gpg-agent = {
Service = {
Environment = lib.mkForce [
"GPG_TTY=/dev/tty1"
"DISPLAY=:0"
"GNUPGHOME=${config.programs.gpg.homedir}"
];
};
};
persist.state.directories = [ ".local/share/gnupg" ];
};
}