feat(home): GnuPG
This commit is contained in:
parent
4f63d4d24f
commit
0b1015ebe1
3 changed files with 39 additions and 17 deletions
|
@ -27,6 +27,7 @@ in
|
||||||
gh = enabled;
|
gh = enabled;
|
||||||
git = enabled;
|
git = enabled;
|
||||||
glow = enabled;
|
glow = enabled;
|
||||||
|
gpg = enabled;
|
||||||
journalctl = enabled;
|
journalctl = enabled;
|
||||||
neo = enabled;
|
neo = enabled;
|
||||||
systemctl = 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