summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/main.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index eb8259ed..1b4bff36 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -60,8 +60,11 @@
 ;; #+BEGIN_SRC emacs-lisp
 (eval-and-compile
   (require 'seq)
-  (defvar nix-emacs (and (string-match "^/nix/store" invocation-directory)
-                         (not (null (seq-some (lambda (dir) (string-match "^/nix/store" dir)) load-path)))))
+  (defun is-nix-emacs ()
+    (and invocation-directory
+         (string-match "^/nix/store" invocation-directory)
+         (not (null (seq-some (lambda (dir) (string-match "^/nix/store" dir)) load-path)))))
+  (defvar nix-emacs (is-nix-emacs))
 
   (setq tls-checktrust t
         gnutls-verify-error t