Files
sydnix/modules/home/gpg.nix
Madeleine Sydney d203a71aaa feat: Encryption
2025-02-18 15:59:17 -07:00

31 lines
716 B
Nix
Executable File

{ config, lib, pkgs, ... }:
let cfg = config.sydnix.gpg;
mutableSymlink = config.lib.file.mkOutOfStoreSymlink;
in {
options = {
sydnix.gpg = {
enable = lib.mkEnableOption "GnuPG";
};
};
config = lib.mkIf cfg.enable {
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
enableBashIntegration = config.programs.bash.enable;
extraConfig =
"allow-loopback-pinentry"
+ lib.optionalString
config.programs.emacs.enable "\nallow-emacs-pinentry";
};
home.file."private-keys/gpg/crumb".source =
mutableSymlink "/persist/private-keys/gpg/${config.home.username}";
};
}