diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 8ddc9bf..2db41c3 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -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 { diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 5e2b497..de64a64 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -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;