Add emacs server config

This commit is contained in:
Erwin Boskma 2022-03-28 14:26:33 +02:00
parent 0d6083c4c7
commit 437090ba75
Signed by: erwin
GPG key ID: 270B20D17394F7E5
2 changed files with 33 additions and 9 deletions

View file

@ -6,21 +6,42 @@
}:
with lib; let
cfg = config.eboskma.programs.emacs;
emacs = pkgs.emacsPgtkGcc;
orgProtocolDesktop = pkgs.makeDesktopItem {
name = "org-protocol";
desktopName = "Emacs Org Protocol Handler";
icon = "emacs";
categories = ["Development" "TextEditor"];
keywords = ["org-protocol"];
type = "Application";
exec = "${emacs}/bin/emacsclient -- %u";
terminal = false;
mimeTypes = ["x-scheme-handler/org-protocol"];
startupWMClass = "Emacs";
};
in {
options.eboskma.programs.emacs = {enable = mkEnableOption "activate emacs";};
# imports = [ inputs.nix-doom-emacs.hmModule ];
options.eboskma.programs.emacs = {
enable = mkEnableOption "activate emacs";
daemon = mkOption {
description = "Whether to enable emacs daemon";
type = types.bool;
default = true;
example = false;
};
};
config = mkIf (cfg.enable) {
programs.emacs = {
enable = true;
package = pkgs.emacsPgtkGcc;
};
# programs.doom-emacs = {
# enable = true;
# emacsPackage = pkgs.emacs-nox;
# doomPrivateDir = ./doom.d;
# };
services.emacs = mkIf (cfg.daemon) {
enable = true;
package = emacs;
client.enable = true;
socketActivation.enable = true;
};
home.packages = with pkgs; [
(texlive.combine {

View file

@ -53,7 +53,10 @@ in {
bat.enable = true;
dropbox.enable = true;
dunst.enable = true;
emacs.enable = true;
emacs = {
enable = true;
daemon = true;
};
electron = {
enable = true;
wayland = true;