]> Git — Sourcephile - julm/julm-nix.git/blob - homes/programs/emacs.nix
nix-serve: allow user to connect to nix-daemon
[julm/julm-nix.git] / homes / programs / emacs.nix
1 { inputs, pkgs, lib, config, ... }:
2 {
3 options.programs.doom-emacs = {
4 enable = lib.mkEnableOption "doom-emacs";
5 };
6 config = lib.mkIf config.programs.doom-emacs.enable {
7 /*
8 imports = [
9 inputs.nix-doom-emacs.hmModule
10 ];
11 programs.doom-emacs = {
12 enable = true;
13 doomPrivateDir =
14 "${config.home.homeDirectory}/.doom.d";
15 };
16 */
17 services.emacs = {
18 enable = true; # Use with emacsclient -c
19 package = config.programs.emacs.package;
20 client.enable = true;
21 socketActivation.enable = true;
22 };
23 fonts.fontconfig.enable = true;
24 home.packages = with pkgs; [
25 # DOOM Emacs dependencies
26 binutils
27 (ripgrep.override { withPCRE2 = true; })
28 fd
29 gnutls
30 hack-font
31 imagemagick
32 zstd
33 #nodePackages.javascript-typescript-langserver
34 sqlite
35 editorconfig-core-c
36 emacs
37 emacs-all-the-icons-fonts
38 ];
39 home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
40 home.sessionVariables = {
41 DOOMDIR = "${config.xdg.configHome}/doom-config";
42 DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
43 };
44 xdg.configFile = {
45 "doom-config/cli.el".source = emacs/cli.el;
46 "doom-config/config.el".source = emacs/config.el;
47 "doom-config/init.el".source = emacs/init.el;
48 "doom-config/packages.el".source = emacs/packages.el;
49 "emacs" = {
50 source = inputs.doom-emacs;
51 onChange = "${pkgs.writeShellScript "doom-change" ''
52 export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
53 export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
54 if [ ! -d "$DOOMLOCALDIR" ]; then
55 ${config.xdg.configHome}/emacs/bin/doom -y install
56 else
57 ${config.xdg.configHome}/emacs/bin/doom -y sync -u
58 fi
59 ''}";
60 };
61 };
62 xresources.properties = {
63 #"Emacs.FontBackend" = "xft";
64 };
65 };
66 }