Merge pull request #759 from patrl/nixosOptions
Improve lang/nix module
This commit is contained in:
commit
c85cd7a557
3 changed files with 38 additions and 0 deletions
21
modules/lang/nix/config.el
Normal file
21
modules/lang/nix/config.el
Normal 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))
|
9
modules/lang/nix/doctor.el
Normal file
9
modules/lang/nix/doctor.el
Normal 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."))
|
||||
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue