]> Git — Sourcephile - julm/julm-nix.git/blob - homes/programs/emacs.nix
font: improve on emacs
[julm/julm-nix.git] / homes / programs / emacs.nix
1 { inputs, pkgs, lib, config, ... }:
2 {
3 options = {
4 programs.doom-emacs = {
5 enable = lib.mkEnableOption "doom-emacs";
6 };
7 };
8 config = lib.mkIf config.programs.doom-emacs.enable {
9 /*
10 imports = [
11 inputs.nix-doom-emacs.hmModule
12 ];
13 programs.doom-emacs = {
14 enable = true;
15 doomPrivateDir =
16 "${config.home.homeDirectory}/.doom.d";
17 };
18 services.emacs = {
19 #enable = true; # Use with emacsclient -c
20 package = config.programs.emacs.package;
21 };
22 */
23 home.packages = with pkgs; [
24 # DOOM Emacs dependencies
25 binutils
26 (ripgrep.override { withPCRE2 = true; })
27 gnutls
28 fd
29 imagemagick
30 zstd
31 #nodePackages.javascript-typescript-langserver
32 sqlite
33 editorconfig-core-c
34 emacs
35 emacs-all-the-icons-fonts
36 ];
37 home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
38 home.sessionVariables = {
39 DOOMDIR = "${config.xdg.configHome}/doom-config";
40 DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
41 };
42 xdg.configFile = {
43 #"doom-config/cli.el".text = "";
44 #"doom-config/config.el".source = emacs/config.el;
45 #"doom-config/init.el".source = emacs/init.el;
46 #"doom-config/packages.el".text = "";
47 "emacs" = {
48 source = inputs.doom-emacs;
49 onChange = "${pkgs.writeShellScript "doom-change" ''
50 export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
51 export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
52 if [ ! -d "$DOOMLOCALDIR" ]; then
53 ${config.xdg.configHome}/emacs/bin/doom -y install
54 else
55 ${config.xdg.configHome}/emacs/bin/doom -y sync -u
56 fi
57 ''}";
58 };
59 };
60 xresources.properties = {
61 # Enable subpixel rendering
62 # https://bbs.archlinux.org/viewtopic.php?pid=1080864#p1080864
63 # https://www.emacswiki.org/emacs/XftGnuEmacs#h5o-17
64 "Xft.antialias" = "rgba";
65 "Xft.hinting" = true;
66 "Xft.hintstyle" = "hintfull";
67 "Xft.rgba" = "rgb";
68 "Emacs.FontBackend" = "xft";
69 "Xft.embolden" = true;
70 };
71 };
72 }