summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--user/emacs/init.el17
-rw-r--r--user/settings/emacs.nix11
2 files changed, 11 insertions, 17 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 7083e58f..f64bb226 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -25,23 +25,6 @@
   (setq use-package-expand-minimally t))
 (setq use-package-always-demand (daemonp))
 
-(defvar ap/path-configured nil)
-(when (and (eq system-type 'darwin)
-           (not ap/path-configured))
-  (setq exec-path
-        (delete-dups
-         (append
-          (parse-colon-path
-           (setenv "PATH"
-                   (elt (split-string-and-unquote
-                         (with-output-to-string
-                           (with-current-buffer standard-output
-                             (call-process "/usr/libexec/path_helper" nil t nil "-s")))
-                         "[=;]")
-                        1)))
-          exec-path))
-        ap/path-configured t))
-
 ;;; Customize
 
 (setq custom-file (expand-file-name "custom.el" user-emacs-directory))
diff --git a/user/settings/emacs.nix b/user/settings/emacs.nix
index 51ce32ca..4ca2dbb5 100644
--- a/user/settings/emacs.nix
+++ b/user/settings/emacs.nix
@@ -6,6 +6,11 @@
 let
   inherit (pkgs) stdenv;
 
+  darwinPath = pkgs.runCommandLocal "path_helper " { } ''
+    eval $(/usr/libexec/path_helper -s)
+    echo -n $PATH > $out
+  '';
+
   editorScript = pkgs.writeScriptBin "edit" ''
     #!${pkgs.runtimeShell}
     if [ -z "$1" ]; then
@@ -151,6 +156,12 @@ in
         yaml-mode
         yasnippet
       ]);
+    extraConfig = ''
+      (with-eval-after-load 'editorconfig
+        (setq editorconfig-exec-path "${pkgs.editorconfig-core-c}/bin/editorconfig"))
+    '' + lib.optionalString stdenv.isDarwin ''
+      (setq exec-path (parse-colon-path (setenv "PATH" "${pkgs.lib.readFile darwinPath}")))
+    '';
   };
   home.packages = [
     editorScript