From f082ca8aead014318e2cbda41ba671791a405f0b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 8 Nov 2019 22:05:43 +0100 Subject: Emacs: set PATH on darwin using built-in path_helper This should be faster than exec-path-from-shell, as it doesn't use a shell. It is not portable, but only macOS lacks a convienent method to set the PATH for graphical applications --- user/emacs/.emacs.d/init.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/user/emacs/.emacs.d/init.el b/user/emacs/.emacs.d/init.el index f608d4cf..701156a3 100644 --- a/user/emacs/.emacs.d/init.el +++ b/user/emacs/.emacs.d/init.el @@ -17,6 +17,22 @@ (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 + (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 "~/.emacs.d/custom.el") -- cgit 1.4.1 From b53a05c7a0941ce8b7a480d9cbf317578dbac031 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 8 Nov 2019 23:22:35 +0100 Subject: zsh: fix global compinit setting breaking darwin --- system/settings/programs/shell.nix | 1 - user/settings/nixos.nix | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/system/settings/programs/shell.nix b/system/settings/programs/shell.nix index 4dd65c4a..a8d4f56f 100644 --- a/system/settings/programs/shell.nix +++ b/system/settings/programs/shell.nix @@ -3,7 +3,6 @@ { programs.zsh = { enable = true; promptInit = ""; - enableGlobalCompInit = false; }; programs.bash.enableCompletion = true; } diff --git a/user/settings/nixos.nix b/user/settings/nixos.nix index cf098b21..526d8ea5 100644 --- a/user/settings/nixos.nix +++ b/user/settings/nixos.nix @@ -12,14 +12,17 @@ }) ]; - programs.zsh.shellAliases = { - nor = "nixos-rebuild"; - snor = "sudo nixos-rebuild"; - nors = "nixos-rebuild switch"; - snors = "sudo nixos-rebuild switch"; - norb = "nixos-rebuild boot"; - snorb = "sudo nixos-rebuild boot"; - norr = "nixos-rebuild switch --rollback"; - snorr = "sudo nixos-rebuild switch --rollback"; + programs.zsh = { + enableGlobalCompInit = false; + shellAliases = { + nor = "nixos-rebuild"; + snor = "sudo nixos-rebuild"; + nors = "nixos-rebuild switch"; + snors = "sudo nixos-rebuild switch"; + norb = "nixos-rebuild boot"; + snorb = "sudo nixos-rebuild boot"; + norr = "nixos-rebuild switch --rollback"; + snorr = "sudo nixos-rebuild switch --rollback"; + }; }; } -- cgit 1.4.1