From 55f2197e8b1e161f80d7730585ee73c13af80651 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 4 Jan 2024 21:51:11 +0530 Subject: [PATCH] use gnome-keyring for ssh-agent --- home/programs/zsh.nix | 12 ++++++++++-- home/services/default.nix | 6 ++++-- home/services/gpg-agent.nix | 1 - hosts/skipper/programs/default.nix | 1 - hosts/skipper/programs/gnupg.nix | 1 - 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/home/programs/zsh.nix b/home/programs/zsh.nix index c709154..aad6d3a 100644 --- a/home/programs/zsh.nix +++ b/home/programs/zsh.nix @@ -1,7 +1,12 @@ { config , pkgs , ... -}: { +}: +let + gnome-keyring-daemon = "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon"; + hyprland = "${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland"; +in +{ programs.zsh = { enable = true; defaultKeymap = "viins"; @@ -15,10 +20,13 @@ }; initExtra = '' bindkey -v '^?' backward-delete-char + + eval $(${gnome-keyring-daemon} -s -d 2> /dev/null) + export SSH_AUTH_SOCK ''; profileExtra = '' if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then - exec ${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland + exec ${hyprland} fi ''; shellAliases = { diff --git a/home/services/default.nix b/home/services/default.nix index a9861be..8a7b354 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -4,7 +4,9 @@ _: { ./gpg-agent.nix ]; services = { - gnome-keyring.enable = true; - ssh-agent.enable = true; + gnome-keyring = { + enable = true; + components = [ "pkcs11" "secrets" "ssh" ]; + }; }; } diff --git a/home/services/gpg-agent.nix b/home/services/gpg-agent.nix index dcd8ebf..c1552dd 100644 --- a/home/services/gpg-agent.nix +++ b/home/services/gpg-agent.nix @@ -2,7 +2,6 @@ _: { services = { gpg-agent = { enable = true; - enableExtraSocket = true; enableScDaemon = true; pinentryFlavor = "gnome3"; }; diff --git a/hosts/skipper/programs/default.nix b/hosts/skipper/programs/default.nix index a52c0da..e88f03f 100644 --- a/hosts/skipper/programs/default.nix +++ b/hosts/skipper/programs/default.nix @@ -9,7 +9,6 @@ _: { fuse.userAllowOther = true; git.enable = true; seahorse.enable = true; - ssh.startAgent = true; xwayland.enable = true; zsh.enable = true; }; diff --git a/hosts/skipper/programs/gnupg.nix b/hosts/skipper/programs/gnupg.nix index f9c0c29..d7fe724 100644 --- a/hosts/skipper/programs/gnupg.nix +++ b/hosts/skipper/programs/gnupg.nix @@ -1,7 +1,6 @@ _: { programs.gnupg.agent = { enable = true; - enableExtraSocket = true; pinentryFlavor = "gnome3"; }; }