2025-01-11 12:02:47 +08:00
|
|
|
{
|
|
|
|
|
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 {
|
2025-01-11 16:27:01 +08:00
|
|
|
services.gpg-agent = lib.mkMerge [
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSshSupport = true;
|
2025-01-11 16:57:54 +08:00
|
|
|
pinentryPackage = pkgs.pinentry-qt;
|
2025-01-11 16:27:01 +08:00
|
|
|
}
|
|
|
|
|
(lib.mkIf config.youthlic.programs.fish.enable {
|
|
|
|
|
enableFishIntegration = true;
|
|
|
|
|
})
|
|
|
|
|
(lib.mkIf config.youthlic.programs.bash.enable {
|
|
|
|
|
enableBashIntegration = true;
|
|
|
|
|
})
|
|
|
|
|
];
|
2025-01-10 21:40:44 +08:00
|
|
|
programs.gpg = {
|
|
|
|
|
enable = true;
|
|
|
|
|
mutableKeys = true;
|
|
|
|
|
mutableTrust = true;
|
|
|
|
|
publicKeys = [
|
|
|
|
|
{
|
|
|
|
|
source = ./public-key.txt;
|
|
|
|
|
trust = "ultimate";
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|