Move gpg into home-manager

This commit is contained in:
Nathan McCarty 2022-10-02 21:53:40 -04:00
parent 175be8db19
commit a22a3f390b
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
3 changed files with 20 additions and 23 deletions

View File

@ -14,6 +14,7 @@ with lib; with nLib; {
./programs/image-editing.nix
./programs/media.nix
./programs/wine.nix
./programs/gpg.nix
./services/syncthing.nix
./services/email.nix
];
@ -36,6 +37,8 @@ with lib; with nLib; {
util = {
# Wine support, disabled by default
wine = mkEnableOption "wine";
# GPG support, enabled by default on desktop
gpg = mkEnableOptionT "gpg";
};
devel = {
jvm = mkDefaultOption "JVM Development Utilites" config.nathan.config.isDesktop;

View File

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.nathan.programs.util.gpg {
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true;
enableExtraSocket = true;
extraConfig = ''
allow-emacs-pinentry
'';
};
};
}

View File

@ -6,29 +6,6 @@ in
with lib;
{
config = mkIf np.gpg {
# Setup environment for gpg agent
environment.shellInit = ''
export GPG_TTY="$(tty)"
gpg-connect-agent /bye
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
'';
environment.sessionVariables = {
SSH_AUTH_SOCK =
"/run/user/1000/gnupg/S.gpg-agent.ssh";
};
programs = {
# Disable ssh-agent, the gpg-agent will fill in
ssh.startAgent = false;
# Enable gpg-agent with ssh support
gnupg.agent = {
enable = true;
enableSSHSupport = true;
enableExtraSocket = true;
};
};
# Enable ykpersonalize to work
services.udev.packages = [ pkgs.yubikey-personalization ];
# Enable smartcard service