Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion plugins/editor/core.el
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,21 @@
(setq ido-everywhere t) ;; Use ido for more completion tasks
;; Changes the way ido displays the completion list
(setq ido-decorations (quote ("\n-> " "" "\n " "\n ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(setq-default explicit-shell-file-name "/run/current-system/sw/bin/fish")
;; Nix-provided tools are wired in via PATH (see nix/package.nix's
;; makeWrapper), not baked-in store paths, so resolve the shell the same
;; way: prefer fish if it's on PATH (e.g. via extraRuntimeInputs), fall
;; back to the user's own $SHELL, then a plain sh. Works whether or not
;; the host is NixOS, and whether or not this is even a Nix-built run.
;; $SHELL is treated as unset when empty: some minimal/broken setups
;; export SHELL="" rather than leaving it unset, and an empty string is
;; non-nil in elisp, so a plain (or ... (getenv "SHELL") ...) would
;; silently accept it and skip the bash/sh fallbacks below.
(setq-default explicit-shell-file-name
(or (executable-find "fish")
(let ((sh (getenv "SHELL")))
(and sh (not (string-empty-p sh)) sh))
(executable-find "bash")
"/bin/sh"))

;; Ensures that Emacs inherits the PATH and other environment variables from your shell.
(pkg/use exec-path-from-shell
Expand Down