2024-01-17 10:39:11 +01:00
|
|
|
# SPDX-FileCopyrightText: 2020-2024 Simon Bruder <simon@sbruder.de>
|
2024-01-06 01:19:35 +01:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2024-04-26 11:41:42 +02:00
|
|
|
{ lib, nixosConfig, pkgs, ... }:
|
2023-12-20 23:32:44 +01:00
|
|
|
|
2020-12-24 23:08:05 +01:00
|
|
|
{
|
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2024-01-21 20:58:25 +01:00
|
|
|
default-key = "D48A1ACAB1CDBD170151662BB1A0B4A45885A031";
|
2024-01-17 10:39:11 +01:00
|
|
|
keyid-format = "none";
|
|
|
|
with-fingerprint = false;
|
|
|
|
with-subkey-fingerprint = true;
|
2020-12-24 23:08:05 +01:00
|
|
|
};
|
|
|
|
};
|
2023-12-20 23:32:44 +01:00
|
|
|
|
|
|
|
services.gpg-agent = rec {
|
|
|
|
enable = true;
|
|
|
|
enableZshIntegration = true;
|
2024-04-26 11:41:42 +02:00
|
|
|
enableSshSupport = lib.mkDefault nixosConfig.sbruder.gui.enable;
|
2023-12-20 23:32:44 +01:00
|
|
|
|
|
|
|
pinentryFlavor = if nixosConfig.sbruder.gui.enable then "gnome3" else "curses";
|
|
|
|
|
|
|
|
defaultCacheTtl = 300;
|
|
|
|
defaultCacheTtlSsh = defaultCacheTtl;
|
|
|
|
maxCacheTtl = 1800;
|
|
|
|
maxCacheTtlSsh = maxCacheTtl;
|
|
|
|
};
|
2024-01-22 17:19:48 +01:00
|
|
|
|
|
|
|
systemd.user.services.yubikey-touch-detector = {
|
|
|
|
Unit.PartOf = [ "sway-session.target" ];
|
|
|
|
Install.WantedBy = [ "sway-session.target" ];
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
Environment = [
|
|
|
|
"PATH=${pkgs.gnupg}/bin"
|
|
|
|
];
|
2024-01-23 22:31:06 +01:00
|
|
|
ExecStart = "${pkgs.yubikey-touch-detector}/bin/yubikey-touch-detector -libnotify";
|
2024-01-22 17:19:48 +01:00
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
2020-12-24 23:08:05 +01:00
|
|
|
}
|