Add NixOS Layer
This commit is contained in:
parent
faa18f49df
commit
01ad10ddbb
|
@ -0,0 +1,37 @@
|
|||
#+TITLE: NixOS contribution layer for Spacemacs
|
||||
|
||||
[[file:img/nixos.jpg]]
|
||||
|
||||
* Table of Contents :TOC@4:
|
||||
- [[#description][Description]]
|
||||
- [[#features][Features:]]
|
||||
- [[#install][Install]]
|
||||
- [[#layer][Layer]]
|
||||
- [[#key-bindings][Key Bindings]]
|
||||
- [[#nixos-options][NixOS Options]]
|
||||
|
||||
* Description
|
||||
|
||||
This layer adds tools for better integration of emacs in NixOS.
|
||||
|
||||
** Features:
|
||||
- Nix-mode using [[https://github.com/NixOS/nix/blob/master/misc/emacs/nix-mode.el][nix-mode]]
|
||||
- Auto-completion of NixOS Options using [[https://github.com/travisbhartwell/nix-emacs/blob/master/company-nixos-options.el][company-nixos-options]]
|
||||
- Helm Lookup for NixOS Options [[https://github.com/travisbhartwell/nix-emacs/blob/master/helm-nixos-options.el][helm-nixos-options]]
|
||||
|
||||
* Install
|
||||
|
||||
** Layer
|
||||
To use this contribution add it to your =~/.spacemacs=
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq-default dotspacemacs-configuration-layers '(nixos))
|
||||
#+END_SRC
|
||||
|
||||
* Key Bindings
|
||||
|
||||
** NixOS Options
|
||||
|
||||
| Key Binding | Description |
|
||||
|-------------+-------------------------|
|
||||
| ~SPC h >~ | Call helm-nixos-options |
|
|
@ -0,0 +1 @@
|
|||
(spacemacs|defvar-company-backends nix-mode)
|
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
|
@ -0,0 +1,29 @@
|
|||
(setq nixos-packages '(nix-mode
|
||||
company
|
||||
nixos-options
|
||||
helm-nixos-options
|
||||
company-nixos-options))
|
||||
|
||||
(defun nixos/init-nix-mode ()
|
||||
(use-package nix-mode))
|
||||
|
||||
(defun nixos/init-nixos-options ()
|
||||
(use-package nixos-options))
|
||||
|
||||
(defun nixos/init-helm-nixos-options ()
|
||||
(use-package helm-nixos-options
|
||||
:config
|
||||
(evil-leader/set-key
|
||||
"h>" 'helm-nixos-options)))
|
||||
|
||||
(when (configuration-layer/layer-usedp 'auto-completion)
|
||||
(defun nixos/post-init-company ()
|
||||
(spacemacs|add-company-hook nix-mode)
|
||||
(push 'company-capf company-backends-nix-mode))
|
||||
|
||||
(defun nixos/init-company-nixos-options ()
|
||||
(use-package company-nixos-options
|
||||
:if (configuration-layer/package-usedp 'company)
|
||||
:defer t
|
||||
:init
|
||||
(push 'company-nixos-options company-backends-nix-mode))))
|
Loading…
Reference in New Issue