emacs: generate PATH at build time
1 file changed, 11 insertions(+), 0 deletions(-)
changed files
M user/settings/emacs.nix → 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 @@ which-key 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