all repos — nixfiles @ 681ed8c8324205d69ad2c083737f72409c3df162

System and user configuration, managed by nix and home-manager

Emacs: use nix wrappers for flycheck iff sandbox detected
Alan Pearce alan@alanpearce.eu
Mon, 26 Jun 2017 14:40:04 +0200
commit

681ed8c8324205d69ad2c083737f72409c3df162

parent

62633dc0fe80f734dc33673c0960905e22fae92b

1 files changed, 8 insertions(+), 2 deletions(-)

jump to
M emacs/.emacs.d/init.orgemacs/.emacs.d/init.org
@@ -428,9 +428,15 @@ (use-package nix-sandbox   :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