Get Spacemacs/Emacs GUI version to recognize nix-shell environment

You can run your GUI Emacs as

setsid nix-shell . --command "emacs" &> /dev/null

Also see discussion about nix-shell integration to flycheck and ghc-mode.


Tip: you can use alias for this in your .zshrc or .bashrc

run-nix-emacs () {
  setsid nix-shell . --command "emacs" &> /dev/null
}

alias ne='run-nix-emacs'

I was able to fix this issue by running space emacs in daemon mode. https://www.emacswiki.org/emacs/EmacsAsDaemon

in the directory with default.nix: nix-shell . emacs --daemon emacsclient -c -a emacs