This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+os/nixos/packages.el
William Casarin 0213035784 nix: enable flycheck
nix syntax checking with nix-instantiate was just merged into flycheck:

  https://github.com/flycheck/flycheck/pull/1164

This enables flycheck support in nix-mode to the nixos layer.
2017-04-19 22:50:17 -04:00

38 lines
1.1 KiB
EmacsLisp

(setq nixos-packages
'(
company
flycheck
(company-nixos-options :toggle
(configuration-layer/package-usedp 'company))
(helm-nixos-options :toggle (configuration-layer/package-usedp 'helm))
nix-mode
nixos-options
))
(defun nixos/post-init-company ()
(let ((backends '(company-capf)))
(when (configuration-layer/package-usedp 'company-nixos-options)
(add-to-list 'backends 'company-nixos-options t))
(eval `(spacemacs|add-company-backends
:backends ,backends
:modes nix-mode))))
(defun nixos/init-company-nixos-options ()
(use-package company-nixos-options
:defer t))
(defun nixos/init-helm-nixos-options ()
(use-package helm-nixos-options
:config
(spacemacs/set-leader-keys
"h>" 'helm-nixos-options)))
(defun nixos/init-nix-mode ()
(use-package nix-mode)
(add-to-list 'spacemacs-indent-sensitive-modes 'nix-mode))
(defun nixos/init-nixos-options ()
(use-package nixos-options))
(defun nixos/post-init-flycheck ()
(spacemacs/enable-flycheck 'nix-mode))