pumpkin: syncoid: exclude Downloads
[julm/julm-nix.git] / home-manager / profiles / emacs.nix
index 499d1dfd22e738aaf617c1f4a3c5e7ff2dc15724..7fb75bf92902df52778930f681174d720c658a3c 100644 (file)
@@ -1,4 +1,10 @@
-{ inputs, pkgs, lib, config, ... }:
+{
+  inputs,
+  pkgs,
+  lib,
+  config,
+  ...
+}:
 {
   /*
     imports = [
@@ -26,7 +32,7 @@
   home.packages = with pkgs; [
     # DOOM Emacs dependencies
     binutils
-    #(ripgrep.override { withPCRE2 = true; })
+    (ripgrep.override { withPCRE2 = true; })
     fd
     gnutls
     hack-font
     #nodePackages.javascript-typescript-langserver
     sqlite
     #editorconfig-core-c
-    emacs-all-the-icons-fonts
+    #emacs-all-the-icons-fonts
+    (nerdfonts.override {
+      fonts = [
+        "NerdFontsSymbolsOnly"
+      ];
+    })
   ];
   home.sessionPath = [ "${config.xdg.configHome}/emacs/bin" ];
   home.sessionVariables = {
-    DOOMDIR = "${config.xdg.configHome}/doom-config";
-    DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
+    DOOMDIR = "${config.xdg.configHome}/doom";
+    DOOMLOCALDIR = "${config.xdg.dataHome}/doom";
+    DOOMPROFILELOADFILE = "${config.xdg.stateHome}/doom/load.el";
   };
   xdg.configFile = {
-    "doom-config/cli.el".text = lib.readFile emacs/cli.el;
-    "doom-config/config.el".text = lib.readFile emacs/config.el;
-    "doom-config/init.el".text = lib.readFile emacs/init.el;
-    "doom-config/packages.el".text = lib.readFile emacs/packages.el;
+    "doom/cli.el".text = lib.readFile emacs/cli.el;
+    "doom/config.el".text = lib.readFile emacs/config.el;
+    "doom/init.el".text = lib.readFile emacs/init.el;
+    "doom/packages.el".text = lib.readFile emacs/packages.el;
     "emacs" = {
       source = inputs.doom-emacs;
+      # FIXME: the first install takes ages, it timeouts home-manager-${USER}.service
       onChange = "${pkgs.writeShellScript "doom-change" ''
-      export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
-      export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
-      if [ ! -d "$DOOMLOCALDIR" ]; then
-        ${config.xdg.configHome}/emacs/bin/doom -y install
-      else
-        ${config.xdg.configHome}/emacs/bin/doom -y sync -u
-      fi
-    ''}";
+        export DOOMDIR="${config.home.sessionVariables.DOOMDIR}"
+        export DOOMLOCALDIR="${config.home.sessionVariables.DOOMLOCALDIR}"
+        export DOOMPROFILELOADFILE="${config.home.sessionVariables.DOOMPROFILELOADFILE}"
+        if [ ! -d "$DOOMLOCALDIR" ]; then
+          ${config.xdg.configHome}/emacs/bin/doom install
+        else
+          ${config.xdg.configHome}/emacs/bin/doom sync
+        fi
+      ''}";
     };
   };
   xresources.properties = {