2022-02-03 22:57:53 +01:00
|
|
|
{
|
2022-03-01 22:19:03 +01:00
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.programs.emacs;
|
2022-03-28 14:26:33 +02:00
|
|
|
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";
|
|
|
|
};
|
2022-03-01 22:19:03 +01:00
|
|
|
in {
|
2022-03-28 14:26:33 +02:00
|
|
|
options.eboskma.programs.emacs = {
|
|
|
|
enable = mkEnableOption "activate emacs";
|
|
|
|
daemon = mkOption {
|
|
|
|
description = "Whether to enable emacs daemon";
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
example = false;
|
|
|
|
};
|
|
|
|
};
|
2022-02-09 08:13:16 +01:00
|
|
|
|
2022-02-03 22:57:53 +01:00
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
programs.emacs = {
|
|
|
|
enable = true;
|
2022-02-09 08:13:16 +01:00
|
|
|
package = pkgs.emacsPgtkGcc;
|
2022-02-03 22:57:53 +01:00
|
|
|
};
|
2022-03-28 14:26:33 +02:00
|
|
|
|
|
|
|
services.emacs = mkIf (cfg.daemon) {
|
|
|
|
enable = true;
|
|
|
|
package = emacs;
|
|
|
|
client.enable = true;
|
|
|
|
socketActivation.enable = true;
|
|
|
|
};
|
2022-03-18 21:14:51 +01:00
|
|
|
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
(texlive.combine {
|
|
|
|
inherit (texlive) scheme-small wrapfig ulem capt-of;
|
|
|
|
})
|
2022-03-29 09:31:35 +02:00
|
|
|
orgProtocolDesktop
|
2022-04-11 09:57:19 +02:00
|
|
|
nodePackages.bash-language-server
|
2022-03-18 21:14:51 +01:00
|
|
|
];
|
2022-02-03 22:57:53 +01:00
|
|
|
};
|
|
|
|
}
|