nixos/home/modules/gpg/default.nix

43 lines
762 B
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}:
2025-01-10 21:40:44 +08:00
{
options = {
youthlic.programs.gpg = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
whether enable gpg
'';
};
};
};
config =
let
cfg = config.youthlic.programs.gpg;
in
lib.mkIf cfg.enable {
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryPackage = pkgs.pinentry-all;
2025-01-10 21:40:44 +08:00
};
programs.gpg = {
enable = true;
mutableKeys = true;
mutableTrust = true;
publicKeys = [
{
source = ./public-key.txt;
trust = "ultimate";
}
];
};
};
}