From 7646038b6fbbc3ade6dfc6fa8dc05b2625604836 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Thu, 16 Feb 2023 22:43:37 +0100 Subject: [PATCH] Emacs as daemon Adding `$SSH_AUTH_SOCK` for `magit` --- hmModules/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hmModules/default.nix b/hmModules/default.nix index e4e4061..ac01b51 100644 --- a/hmModules/default.nix +++ b/hmModules/default.nix @@ -31,13 +31,16 @@ package = ccrEmacsConfig.package; }; services.emacs = { - # TODO Re-enable, this is causing some problems with magit, probably it - # would be sufficient disabling `socketActivation` - enable = false; - client.enable = false; - defaultEditor = false; + enable = true; + client.enable = true; + defaultEditor = true; socketActivation.enable = false; - startWithUserSession = false; # when I log out I don't want Emacs server to exit + startWithUserSession = false; + }; + systemd.user.sessionVariables = { + # TODO user `gpgconf --list-dirs agent-ssh-socket` + # and better manage when gpg is not installed (do not make magit crash) + SSH_AUTH_SOCK = "/run/user/1000/gnupg/S.gpg-agent.ssh"; }; home.packages = with pkgs; [