diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-08-03 20:39:23 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-08-03 20:39:23 +0200 |
| commit | 5a081e09ced0d5e3eb2c51a8920b0afeb5467254 (patch) | |
| tree | 548af713ec6c223c5a58015f1e0e260c6b0f4a49 | |
| parent | 6424eb998d01d706aaef33dcec31a7ec44098007 (diff) | |
vim: expose programs.vim.package
| -rw-r--r-- | modules/programs/vim.nix | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index 578c8f8..bceae54 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -5,15 +5,6 @@ with lib; let cfg = config.programs.vim; - vim = pkgs.vim_configurable.customize { - name = "vim"; - vimrcConfig.customRC = config.environment.etc."vimrc".text; - vimrcConfig.vam = { - knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins; - pluginDictionaries = cfg.plugins; - }; - }; - text = import ../lib/write-text.nix { inherit lib; mkTextDerivation = name: text: pkgs.writeText "vim-options-${name}" text; @@ -65,6 +56,11 @@ in description = "VAM plugin dictionaries to use for vim_configurable."; }; + programs.vim.package = mkOption { + internal = true; + type = types.package; + }; + programs.vim.vimOptions = mkOption { internal = true; type = types.attrsOf (types.submodule text); @@ -82,10 +78,10 @@ in environment.systemPackages = [ # Include vim_configurable package. - vim + cfg.package ]; - environment.variables.EDITOR = "${vim}/bin/vim"; + environment.variables.EDITOR = "${cfg.package}/bin/vim"; environment.etc."vimrc".text = '' ${vimOptions} @@ -96,6 +92,15 @@ in endif ''; + programs.vim.package = pkgs.vim_configurable.customize { + name = "vim"; + vimrcConfig.customRC = config.environment.etc."vimrc".text; + vimrcConfig.vam = { + knownPlugins = pkgs.vimPlugins // cfg.extraKnownPlugins; + pluginDictionaries = cfg.plugins; + }; + }; + programs.vim.plugins = mkIf cfg.enableSensible [ { names = [ "fugitive" "surround" "vim-nix" ]; } ]; |
