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
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;
};