nixos/home/modules/gpg/default.nix

36 lines
703 B
Nix

{ 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";
}
];
};
};
}