nixos-config/backup/modules/users/gpg/default.nix
2021-11-12 07:23:46 +01:00

32 lines
551 B
Nix

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.erwin.gpg;
in {
options.erwin.gpg = {
enable = mkOption {
description = "Enable GPG";
type = types.bool;
default = false;
};
};
config = mkIf (cfg.enable) {
home.packages = with pkgs; [
pinentry-curses
];
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
enableSshSupport = true;
defaultCacheTtlSsh = 14400;
maxCacheTtlSsh = 14400;
};
};
}