From 2ae649af8042acfd8d155816a2783e12035186c8 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 15 Apr 2024 08:44:09 +0200 Subject: [PATCH] configuration/gpg-ssh: Move GPG and SSH integration to seperate module --- configuration/desktop/ssh.nix | 13 ++++--------- configuration/gpg-ssh/default.nix | 21 +++++++++++++++++++++ hosts/_iso/configuration.nix | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 configuration/gpg-ssh/default.nix diff --git a/configuration/desktop/ssh.nix b/configuration/desktop/ssh.nix index 87e4cd2..63deb0d 100644 --- a/configuration/desktop/ssh.nix +++ b/configuration/desktop/ssh.nix @@ -1,19 +1,14 @@ { pkgs, ... }: { + + imports = [ + ../../configuration/gpg-ssh + ]; programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; pinentryPackage = pkgs.pinentry-gtk2; }; - # Add wrapper around ssh that takes the gnupg ssh-agent - # instead of gnome-keyring - environment.systemPackages = with pkgs; [ - ssh-gpg - ]; - - # Do not disable ssh-agent of gnome-keyring, because # gnupg ssh-agent can't handle normal SSH keys properly /* diff --git a/configuration/gpg-ssh/default.nix b/configuration/gpg-ssh/default.nix new file mode 100644 index 0000000..e3daea7 --- /dev/null +++ b/configuration/gpg-ssh/default.nix @@ -0,0 +1,21 @@ +{ pkgs, lib, ... }: + +{ + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryPackage = lib.mkDefault pkgs.pinentry-curses; + }; + + environment.systemPackages = with pkgs; [ + gnupg + + # Add wrapper around ssh that takes the gnupg ssh-agent + # instead of gnome-keyring + ssh-gpg + ]; + + services.pcscd.enable = true; + +} diff --git a/hosts/_iso/configuration.nix b/hosts/_iso/configuration.nix index 88ccf9c..4db915c 100644 --- a/hosts/_iso/configuration.nix +++ b/hosts/_iso/configuration.nix @@ -3,6 +3,7 @@ { imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-base.nix") + ../../configuration/gpg-ssh ]; networking.hostName = "isowo";