summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-06-26 14:40:04 +0200
committerAlan Pearce2017-06-26 14:40:04 +0200
commit681ed8c8324205d69ad2c083737f72409c3df162 (patch)
treeaba4f8b3e60f808e468cb4f70b2f1f7c506945f6 /emacs
parent62633dc0fe80f734dc33673c0960905e22fae92b (diff)
downloadnixfiles-681ed8c8324205d69ad2c083737f72409c3df162.tar.lz
nixfiles-681ed8c8324205d69ad2c083737f72409c3df162.tar.zst
nixfiles-681ed8c8324205d69ad2c083737f72409c3df162.zip
Emacs: use nix wrappers for flycheck iff sandbox detected
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.org10
1 files changed, 8 insertions, 2 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index aa2ea28d..30046891 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -428,9 +428,15 @@ and some convenience commands for building packages and launching shells.
   :config (progn
             (with-eval-after-load 'flycheck
               (setq flycheck-command-wrapper-function
-                    (lambda (command) (apply 'nix-shell-command (nix-current-sandbox) command))
+                    (lambda (command)
+                      (if (nix-current-sandbox)
+                          (apply 'nix-shell-command (nix-current-sandbox) command)
+                        command))
                     flycheck-executable-find
-                    (lambda (cmd) (nix-executable-find (nix-current-sandbox) cmd))))))
+                    (lambda (cmd)
+                      (if (nix-current-sandbox)
+                          (nix-executable-find (nix-current-sandbox) cmd)
+                        (executable-find cmd)))))))
 #+END_SRC
 
 * Keybindings