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
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00

43 lines
1.1 KiB
EmacsLisp

(defconst nixos-packages
'(
company
flycheck
(company-nixos-options :requires company)
(helm-nixos-options :requires helm)
nix-mode
nixos-options
))
(defun nixos/post-init-company ()
(let ((backends '(company-capf)))
(when (configuration-layer/package-used-p '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
:defer t
:init
(progn
(spacemacs/set-leader-keys
"h>" 'helm-nixos-options))))
(defun nixos/init-nix-mode ()
(use-package nix-mode
:defer t
:init
(add-to-list 'spacemacs-indent-sensitive-modes 'nix-mode)
:config
(electric-indent-mode -1)))
(defun nixos/init-nixos-options ()
(use-package nixos-options :defer t))
(defun nixos/post-init-flycheck ()
(spacemacs/enable-flycheck 'nix-mode))