2015-12-02 14:23:39 +00:00
#+TITLE : NixOS layer
2015-07-20 20:11:08 +00:00
2019-05-02 21:49:30 +00:00
#+TAGS : layer|os
2019-10-19 07:04:12 +00:00
[[file:img/nixos.png ]]
2015-07-20 20:11:08 +00:00
2021-08-25 22:37:51 +00:00
* Table of Contents :TOC_5_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description ][Description ]]
- [[#features ][Features: ]]
- [[#install ][Install ]]
- [[#layer ][Layer ]]
2021-08-20 03:09:00 +00:00
- [[#format-on-save ][Format on save ]]
2020-01-07 03:23:06 +00:00
- [[#configuration ][Configuration ]]
2018-12-05 03:03:03 +00:00
- [[#key-bindings ][Key bindings ]]
2017-05-22 14:16:12 +00:00
- [[#nixos-options ][NixOS Options ]]
2015-07-20 20:11:08 +00:00
* Description
2019-06-01 17:13:30 +00:00
This layer adds tools for better integration of Emacs in NixOS.
2015-07-20 20:11:08 +00:00
** Features:
2018-10-23 14:18:21 +00:00
- Nix-mode using [[https://github.com/NixOS/nix-mode ][nix-mode ]]
2021-08-20 03:09:00 +00:00
- Automatic formatting via [[https://github.com/serokell/nixfmt ][nixfmt ]]
2015-07-20 20:11:08 +00:00
- Auto-completion of NixOS Options using [[https://github.com/travisbhartwell/nix-emacs/blob/master/company-nixos-options.el ][company-nixos-options ]]
2018-10-23 14:18:21 +00:00
- Helm Lookup for NixOS Options [[https://github.com/travisbhartwell/nix-emacs/blob/master/helm-nixos-options.el ][helm-nixos-options ]]
2015-07-20 20:11:08 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =nixos= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-07-20 20:11:08 +00:00
2021-08-20 03:09:00 +00:00
** Format on save
To enable automatic formatting on save, set the layer variable
~nixos-format-on-save~ to ~t~ :
2021-08-25 22:37:51 +00:00
#+BEGIN_SRC elisp
2021-08-20 03:09:00 +00:00
(nixos :variables nixos-format-on-save t)
2021-08-25 22:37:51 +00:00
#+END_SRC
2021-08-20 03:09:00 +00:00
2020-01-07 03:23:06 +00:00
* Configuration
2020-01-25 23:47:22 +00:00
On some systems, =company-nixos-options= may be very slow. If this is the case,
see the section on disabling the [[https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org#disabling-layer-services-in-other-layers ][disabling auto-complete ]] for the =nixos= layer.
2020-01-07 03:23:06 +00:00
2018-12-05 03:03:03 +00:00
* Key bindings
2015-07-20 20:11:08 +00:00
** NixOS Options
2021-08-20 03:09:00 +00:00
| Key binding | Description |
|-------------+----------------------------|
| ~SPC h >~ | Call helm-nixos-options |
| ~SPC m = =~ | Format buffer using nixfmt |