add gpg option to home-manager module

This commit is contained in:
Ulic-youthlic 2025-01-10 21:40:44 +08:00
parent 164a1cc64f
commit f778bcb397
5 changed files with 67 additions and 1 deletions

View file

@ -0,0 +1,36 @@
{ config, lib, ... }:
{
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;
};
programs.gpg = {
enable = true;
mutableKeys = true;
mutableTrust = true;
publicKeys = [
{
source = ./public-key.txt;
trust = "ultimate";
}
];
};
};
}