From 7a81f46b39d02e412750ad8ef8d987f4ec4e00c5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 17 Jul 2018 13:23:33 +0200 Subject: [PATCH] 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 --- modules/lang/nix/config.el | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/modules/lang/nix/config.el b/modules/lang/nix/config.el index 48c02ed82..b03095541 100644 --- a/modules/lang/nix/config.el +++ b/modules/lang/nix/config.el @@ -1,16 +1,8 @@ -;;; config.el --- description -*- 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)) +;;; 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 @@ -18,12 +10,12 @@ :n "r" #'nix-repl-show :n "s" #'nix-shell :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) - (map! :map nix-mode-map - :localleader - :n "o" #'helm-nixos-options)) +(def-package! nix-update + :commands (nix-update-fetch)) - (when (featurep! :completion company) - (set-company-backend! 'nix-mode 'company-nixos-options))) +(def-package! nix-repl + :commands (nix-repl-show))