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