2024-05-30 16:54:58 -03:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2022-08-08 21:16:45 -03:00
|
|
|
config = {
|
|
|
|
services.gpg-agent = {
|
|
|
|
enable = true;
|
|
|
|
defaultCacheTtl = 604800;
|
|
|
|
maxCacheTtl = 604800;
|
|
|
|
extraConfig = ''
|
|
|
|
allow-preset-passphrase
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
systemd.user.services = {
|
|
|
|
gpg_unlock = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Unlock gpg keyring";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
2024-05-30 16:54:58 -03:00
|
|
|
Service = {
|
|
|
|
ExecStart = "${pkgs._gpg-unlock}/bin/_gpg-unlock";
|
|
|
|
};
|
2022-08-08 21:16:45 -03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.user.timers = {
|
|
|
|
gpg_unlock = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Unlock gpg keyring";
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
After = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
Timer = {
|
2022-08-08 22:00:45 -03:00
|
|
|
OnBootSec = "0";
|
2022-11-30 14:39:55 -03:00
|
|
|
OnUnitActiveSec = "300";
|
2022-08-08 21:16:45 -03:00
|
|
|
Unit = "gpg_unlock.service";
|
|
|
|
};
|
2024-05-30 16:54:58 -03:00
|
|
|
Install = {
|
|
|
|
WantedBy = [ "sway-session.target" ];
|
|
|
|
};
|
2022-08-08 21:16:45 -03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|