Refactor lang/nix

+ Move set-company-backend! out of conditional (it is an autodef, meaning it will simply no-op if the company module is disabled)
+ Removed helm-nixos-options config, because `helm-nixos-options` is already autoloaded by the package
+ Simplify map! usage
+ Move nix-mode to the top, as it is the focal package of this module
This commit is contained in:
Henrik Lissner 2018-07-17 13:23:33 +02:00 committed by GitHub
parent bd5d305e06
commit 7a81f46b39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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