nixos-config/home/emacs.nix

50 lines
975 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;
};
programs.emacs = {
enable = true;
package = pkgs.emacsNativeComp;
extraPackages = epkgs: [epkgs.vterm epkgs.pdf-tools pkgs.lilypond];
};
};
}