From a8e26d1a33e23fd9d29d54343404e588756fc9ac Mon Sep 17 00:00:00 2001 From: cspark Date: Fri, 12 Apr 2024 13:17:45 +0100 Subject: [PATCH] Setup emacs server --- global-home.nix | 10 ++++++++-- global.nix | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/global-home.nix b/global-home.nix index 8fe31985..b581f5f7 100644 --- a/global-home.nix +++ b/global-home.nix @@ -58,7 +58,7 @@ in firefox librewolf ungoogled-chromium - emacs-gtk + # emacs-gtk telegram-desktop discord lutris @@ -182,6 +182,12 @@ in }; }; + # Emacs install and enable daemon/server mode. Set to use unstable pure gtk branch (From emacs-overlay) + services.emacs = { + enable = true; + package = pkgs.emacs-gtk; + }; + # MPDCRON to automate MPD related events, using it to automatically restart mpd-discord-rpc service to solve issues systemd.user.services.mpdcron = let script = pkgs.writeShellScript "mpdcron-script" @@ -224,7 +230,7 @@ in ]; home.sessionVariables = { - EDITOR = "emacs -nw"; + EDITOR = "emacsclient -nw"; # Dotnet path not found fix DOTNET_ROOT = "${pkgs.dotnet-sdk}"; diff --git a/global.nix b/global.nix index 61538f29..707c8beb 100644 --- a/global.nix +++ b/global.nix @@ -13,6 +13,7 @@ environment.systemPackages = with pkgs; [ nix-index git + gcc nodejs nodePackages.prettier neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. @@ -165,6 +166,25 @@ "; }; + # Emacs install and enable daemon/server mode. + services.emacs = { + enable = true; + package = pkgs.emacs-gtk; + }; + systemd.services.emacs = { + description = "Emacs server daemon for root"; + wantedBy = [ "multi-user.target" ]; + path = with pkgs; [ emacs-gtk ]; + enable = true; + serviceConfig = { + User = "root"; + Group = "root"; + }; + script = " + emacs --daemon + "; + }; + # Virt Manager Installation virtualisation.libvirtd.enable = true; programs.virt-manager.enable = true;