2020-01-07 03:23:06 +00:00
|
|
|
;;; packages.el --- NixOS Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2015-2020 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2020-01-07 03:23:06 +00:00
|
|
|
|
2017-12-07 04:29:03 +00:00
|
|
|
(defconst nixos-packages
|
2020-01-25 23:47:22 +00:00
|
|
|
'((company-nixos-options :requires company)
|
|
|
|
flycheck
|
|
|
|
(helm-nixos-options :requires helm)
|
|
|
|
nix-mode
|
|
|
|
nixos-options))
|
2016-05-30 02:39:21 +00:00
|
|
|
|
|
|
|
(defun nixos/post-init-company ()
|
2020-01-25 23:47:22 +00:00
|
|
|
(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))))
|
2016-05-30 02:39:21 +00:00
|
|
|
|
|
|
|
(defun nixos/init-company-nixos-options ()
|
2020-01-25 23:47:22 +00:00
|
|
|
(use-package company-nixos-options
|
|
|
|
:defer t))
|
2016-05-30 02:39:21 +00:00
|
|
|
|
|
|
|
(defun nixos/init-helm-nixos-options ()
|
|
|
|
(use-package helm-nixos-options
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2017-04-25 15:24:27 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"h>" 'helm-nixos-options))))
|
2015-07-20 20:11:08 +00:00
|
|
|
|
|
|
|
(defun nixos/init-nix-mode ()
|
2017-12-07 04:29:03 +00:00
|
|
|
(use-package nix-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2018-08-12 14:48:33 +00:00
|
|
|
:mode "\\.nix\\'"
|
2017-12-07 04:29:03 +00:00
|
|
|
:init
|
2021-06-06 19:40:46 +00:00
|
|
|
(progn
|
|
|
|
(add-to-list 'spacemacs-indent-sensitive-modes 'nix-mode)
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'nix-mode
|
2021-08-20 03:09:00 +00:00
|
|
|
"==" 'nix-format-buffer)
|
|
|
|
(when nixos-format-on-save
|
|
|
|
(add-hook 'before-save-hook 'nix-format-before-save)))
|
2017-12-07 04:29:03 +00:00
|
|
|
:config
|
|
|
|
(electric-indent-mode -1)))
|
2015-07-20 20:11:08 +00:00
|
|
|
|
|
|
|
(defun nixos/init-nixos-options ()
|
2018-03-04 04:37:53 +00:00
|
|
|
(use-package nixos-options :defer t))
|
2017-04-19 19:09:55 +00:00
|
|
|
|
|
|
|
(defun nixos/post-init-flycheck ()
|
|
|
|
(spacemacs/enable-flycheck 'nix-mode))
|