nixos-config/home/emacs.nix

51 lines
1,021 B
Nix
Raw Normal View History

2022-04-10 11:54:58 +02:00
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
2022-01-11 16:08:21 +01:00
mkEnableOption
mkIf
2022-04-10 11:54:58 +02:00
;
in {
2022-01-11 16:08:21 +01:00
options.my.home.emacs = {
enable = mkEnableOption "Emacs daemon configuration";
};
2022-01-11 16:08:21 +01:00
config = mkIf config.my.home.emacs.enable {
2022-04-10 11:54:58 +02:00
home.sessionPath = ["${config.xdg.configHome}/emacs/bin"];
home.sessionVariables = {
EDITOR = "emacsclient -t";
};
2022-01-11 16:08:21 +01:00
home.packages = builtins.attrValues {
2022-04-10 11:54:58 +02:00
inherit
(pkgs)
2022-01-11 16:08:21 +01:00
sqlite # needed by org-roam
2022-04-10 11:54:58 +02:00
2022-01-11 16:08:21 +01:00
# fonts used by my config
2022-04-10 11:54:58 +02:00
2022-01-11 16:08:21 +01:00
emacs-all-the-icons-fonts
iosevka-bin
2022-04-10 11:54:58 +02:00
;
2022-01-11 16:08:21 +01:00
};
# make sure above fonts are discoverable
fonts.fontconfig.enable = true;
services.emacs = {
enable = true;
# generate emacsclient desktop file
client.enable = true;
2023-12-05 09:20:54 +01:00
socketActivation.enable = true;
};
programs.emacs = {
enable = true;
2024-03-04 22:43:28 +01:00
package = pkgs.emacs29-pgtk;
extraPackages = epkgs: [epkgs.vterm epkgs.pdf-tools pkgs.lilypond epkgs.mu4e];
};
};
}