Merge pull request #759 from patrl/nixosOptions

Improve lang/nix module
This commit is contained in:
Henrik Lissner 2018-07-17 13:29:30 +02:00 committed by GitHub
commit c85cd7a557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,21 @@
;;; lang/nix/config.el -*- lexical-binding: t; -*-
(after! nix-mode
(set-company-backend! 'nix-mode 'company-nixos-options)
(map! :map nix-mode-map
:localleader
:n "f" #'nix-update-fetch
:n "p" #'nix-format-buffer
:n "r" #'nix-repl-show
:n "s" #'nix-shell
:n "b" #'nix-build
:n "u" #'nix-unpack
(:when (featurep! :completion helm)
:n "o" #'helm-nixos-options)))
(def-package! nix-update
:commands (nix-update-fetch))
(def-package! nix-repl
:commands (nix-repl-show))

View file

@ -0,0 +1,9 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/nix/doctor.el
(unless (executable-find "nix")
(warn! "Couldn't find the nix package manager. nix-mode won't work."))
(unless (executable-find "nixfmt")
(warn! "Couldn't find nixfmt. nix-format-buffer won't work."))

View file

@ -2,3 +2,11 @@
;;; lang/nix/packages.el
(package! nix-mode)
(package! nix-update)
(when (featurep! :completion company)
(package! company-nixos-options))
(when (featurep! :completion helm)
(package! helm-nixos-options))