67 lines
1.7 KiB
Nix
67 lines
1.7 KiB
Nix
{ pkgs
|
|
, config
|
|
, lib
|
|
, ...
|
|
}:
|
|
with lib; let
|
|
cfg = config.eboskma.programs.emacs;
|
|
emacs = with pkgs; ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.emacsql epkgs.emacsql-sqlite ]));
|
|
|
|
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";
|
|
};
|
|
|
|
valeToINI = generators.toINIWithGlobalSection {
|
|
mkKeyValue = generators.mkKeyValueDefault
|
|
{
|
|
mkValueString = v:
|
|
if builtins.isList v then builtins.concatStringsSep ", " v
|
|
else generators.mkValueStringDefault { } v;
|
|
} " = ";
|
|
};
|
|
in
|
|
{
|
|
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 = emacs;
|
|
};
|
|
|
|
services.emacs = mkIf cfg.daemon {
|
|
enable = true;
|
|
package = emacs;
|
|
client.enable = true;
|
|
socketActivation.enable = true;
|
|
};
|
|
|
|
home.packages = with pkgs; [
|
|
(texlive.combine {
|
|
inherit (texlive) scheme-small wrapfig ulem capt-of;
|
|
})
|
|
orgProtocolDesktop
|
|
nodePackages.bash-language-server
|
|
aspell
|
|
] ++
|
|
(with aspellDicts; [ en en-computers en-science fy nl ]);
|
|
|
|
};
|
|
}
|