use gnome-keyring for ssh-agent

This commit is contained in:
Adithya 2024-01-04 21:51:11 +05:30
parent 6e76dc6a3d
commit 55f2197e8b
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
5 changed files with 14 additions and 7 deletions

View file

@ -1,7 +1,12 @@
{ config { config
, pkgs , pkgs
, ... , ...
}: { }:
let
gnome-keyring-daemon = "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon";
hyprland = "${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland";
in
{
programs.zsh = { programs.zsh = {
enable = true; enable = true;
defaultKeymap = "viins"; defaultKeymap = "viins";
@ -15,10 +20,13 @@
}; };
initExtra = '' initExtra = ''
bindkey -v '^?' backward-delete-char bindkey -v '^?' backward-delete-char
eval $(${gnome-keyring-daemon} -s -d 2> /dev/null)
export SSH_AUTH_SOCK
''; '';
profileExtra = '' profileExtra = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ] ; then
exec ${config.wayland.windowManager.hyprland.finalPackage}/bin/Hyprland exec ${hyprland}
fi fi
''; '';
shellAliases = { shellAliases = {

View file

@ -4,7 +4,9 @@ _: {
./gpg-agent.nix ./gpg-agent.nix
]; ];
services = { services = {
gnome-keyring.enable = true; gnome-keyring = {
ssh-agent.enable = true; enable = true;
components = [ "pkcs11" "secrets" "ssh" ];
};
}; };
} }

View file

@ -2,7 +2,6 @@ _: {
services = { services = {
gpg-agent = { gpg-agent = {
enable = true; enable = true;
enableExtraSocket = true;
enableScDaemon = true; enableScDaemon = true;
pinentryFlavor = "gnome3"; pinentryFlavor = "gnome3";
}; };

View file

@ -9,7 +9,6 @@ _: {
fuse.userAllowOther = true; fuse.userAllowOther = true;
git.enable = true; git.enable = true;
seahorse.enable = true; seahorse.enable = true;
ssh.startAgent = true;
xwayland.enable = true; xwayland.enable = true;
zsh.enable = true; zsh.enable = true;
}; };

View file

@ -1,7 +1,6 @@
_: { _: {
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableExtraSocket = true;
pinentryFlavor = "gnome3"; pinentryFlavor = "gnome3";
}; };
} }