From 58823d7d3835a832bba449db4011e6b80fb097c6 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Thu, 18 Aug 2022 14:41:46 +0200 Subject: [PATCH] Emacs module improvements - Actually use `cfg.package` - Switch back to pure GTK (Emacs 29 dev) to test --- home-manager/modules/emacs/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 1dcb35a..22fbe06 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -5,7 +5,8 @@ }: with lib; let cfg = config.eboskma.programs.emacs; - emacs = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ])); + emacsX11 = with pkgs; ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ])); + emacsWayland = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ])); orgProtocolDesktop = pkgs.makeDesktopItem { name = "org-protocol"; @@ -14,7 +15,7 @@ with lib; let categories = [ "Development" "TextEditor" ]; keywords = [ "org-protocol" ]; type = "Application"; - exec = "${emacs}/bin/emacsclient -- %u"; + exec = "${cfg.package}/bin/emacsclient -- %u"; terminal = false; mimeTypes = [ "x-scheme-handler/org-protocol" ]; startupWMClass = "Emacs"; @@ -36,7 +37,7 @@ in package = mkOption { description = "The emacs package to install"; type = types.package; - default = emacs; + default = emacsWayland; }; daemon = mkOption { @@ -50,12 +51,12 @@ in config = mkIf cfg.enable { programs.emacs = { enable = true; - package = emacs; + package = cfg.package; }; services.emacs = mkIf cfg.daemon { enable = true; - package = emacs; + package = cfg.package; client.enable = true; socketActivation.enable = true; };