feat(home): Gpg
This commit is contained in:
parent
43ce65fc92
commit
fe80ace7db
3 changed files with 39 additions and 17 deletions
|
@ -27,6 +27,7 @@ in
|
|||
gh = enabled;
|
||||
git = enabled;
|
||||
glow = enabled;
|
||||
gpg = enabled;
|
||||
journalctl = enabled;
|
||||
neo = enabled;
|
||||
systemctl = enabled;
|
||||
|
|
38
modules/home/programs/gpg/default.nix
Normal file
38
modules/home/programs/gpg/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib.${namespace}) mkEnableModule isDesktop;
|
||||
|
||||
cfg = config.${namespace}.programs.gpg;
|
||||
in
|
||||
{
|
||||
options = mkEnableModule "programs.gpg";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# home-manager gpg-agent module doesn't seem to actually install the desired
|
||||
# pinentry program, so we install it here.
|
||||
home.packages = [
|
||||
config.services.gpg-agent.pinentryPackage
|
||||
];
|
||||
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.gpg-agent = rec {
|
||||
enable = true;
|
||||
|
||||
pinentryPackage = if isDesktop then pkgs.pinentry-gtk2 else pkgs.pinentry-curses;
|
||||
|
||||
# Don't ask for the password very often.
|
||||
defaultCacheTtl = 60480000;
|
||||
maxCacheTtl = defaultCacheTtl;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.gpg-agent = rec {
|
||||
enable = true;
|
||||
|
||||
# TODO: Set this to pinentry-curses on non-GUI systems.
|
||||
pinentryPackage = pkgs.pinentry-gtk2;
|
||||
|
||||
# Don't ask for the password very often.
|
||||
defaultCacheTtl = 60480000;
|
||||
maxCacheTtl = defaultCacheTtl;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue