Emacs module improvements

- Actually use `cfg.package`
- Switch back to pure GTK (Emacs 29 dev) to test
This commit is contained in:
Erwin Boskma 2022-08-18 14:41:46 +02:00
parent 603efc7767
commit 58823d7d38
Signed by: erwin
GPG key ID: 270B20D17394F7E5

View file

@ -5,7 +5,8 @@
}: }:
with lib; let with lib; let
cfg = config.eboskma.programs.emacs; 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 { orgProtocolDesktop = pkgs.makeDesktopItem {
name = "org-protocol"; name = "org-protocol";
@ -14,7 +15,7 @@ with lib; let
categories = [ "Development" "TextEditor" ]; categories = [ "Development" "TextEditor" ];
keywords = [ "org-protocol" ]; keywords = [ "org-protocol" ];
type = "Application"; type = "Application";
exec = "${emacs}/bin/emacsclient -- %u"; exec = "${cfg.package}/bin/emacsclient -- %u";
terminal = false; terminal = false;
mimeTypes = [ "x-scheme-handler/org-protocol" ]; mimeTypes = [ "x-scheme-handler/org-protocol" ];
startupWMClass = "Emacs"; startupWMClass = "Emacs";
@ -36,7 +37,7 @@ in
package = mkOption { package = mkOption {
description = "The emacs package to install"; description = "The emacs package to install";
type = types.package; type = types.package;
default = emacs; default = emacsWayland;
}; };
daemon = mkOption { daemon = mkOption {
@ -50,12 +51,12 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.emacs = { programs.emacs = {
enable = true; enable = true;
package = emacs; package = cfg.package;
}; };
services.emacs = mkIf cfg.daemon { services.emacs = mkIf cfg.daemon {
enable = true; enable = true;
package = emacs; package = cfg.package;
client.enable = true; client.enable = true;
socketActivation.enable = true; socketActivation.enable = true;
}; };