commit 326725bda9edd404debb9fc4b698b381d6e84105
parent 7e059a810a4538ca047b3dc551680179449d0b6a
Author: Vincent Demeester <vincent@sbr.pm>
Date: Mon, 6 Apr 2020 14:10:00 +0200
setup-nix.el: load only if *nix* is true…
… aka if `nix' command is available.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/emacs/config/setup-nix.el b/tools/emacs/config/setup-nix.el
@@ -1,16 +1,20 @@
;;; -*- lexical-binding: t; -*-
(use-package nix-mode
+ :if *nix*
:mode ("\\.nix\\'" "\\.nix.in\\'"))
(use-package nix-drv-mode
- :ensure nix-mode
+ :if *nix*
+ :after nix-mode
:mode "\\.drv\\'")
(use-package nix-shell
- :ensure nix-mode
+ :if *nix*
+ :after nix-mode
:commands (nix-shell-unpack nix-shell-configure nix-shell-build))
(use-package nixpkgs-fmt
+ :if *nix*
:after nix-mode
:config
(add-hook 'nix-mode-hook 'nixpkgs-fmt-on-save-mode))