From c80598d4e4ffea73647b2ea8440a6080596968fe Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Mon, 3 Jul 2023 11:27:19 +0300 Subject: 2023-07-03 --- modules/common/vim/default.nix | 62 +++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 34 deletions(-) (limited to 'modules/common/vim/default.nix') diff --git a/modules/common/vim/default.nix b/modules/common/vim/default.nix index 2ee8a0b..3755201 100644 --- a/modules/common/vim/default.nix +++ b/modules/common/vim/default.nix @@ -7,43 +7,37 @@ with lib; let cfg = config.nixfiles.modules.vim; in { - options.nixfiles.modules.vim.enable = mkEnableOption "Vim"; + options.nixfiles.modules.vim = { + enable = mkEnableOption "Vim"; + + rc = mkOption { + type = types.str; + default = readFile ./rc.vim; + description = "Configuration file."; + }; + + plugins = mkOption { + type = with types; listOf package; + default = with pkgs.vimPlugins; [ + editorconfig-vim + vim-eunuch + vim-nix + vim-sensible + vim-sleuth + vim-surround + vim-unimpaired + ]; + description = "Plugins."; + }; + }; config = mkIf cfg.enable { - programs.vim.package = with pkgs; - (vim_configurable.override { - features = "normal"; - cscopeSupport = false; - darwinSupport = pkgs.stdenv.isDarwin; - guiSupport = false; - luaSupport = false; - multibyteSupport = false; - netbeansSupport = false; - nlsSupport = false; - perlSupport = false; - pythonSupport = false; - rubySupport = false; - tclSupport = false; - ximSupport = false; - }) - .customize { - name = "vim"; - vimrcConfig = { - customRC = readFile ./rc.vim; - packages.myVimPackage.start = with vimPlugins; [ - editorconfig-vim - vim-eunuch - vim-nix - vim-sleuth - vim-surround - vim-unimpaired - ]; - }; + environment = with config.programs.vim; { + systemPackages = [package]; + variables = rec { + EDITOR = mkOverride 100 "${package}/bin/vim"; + VISUAL = EDITOR; }; - - environment = { - systemPackages = [config.programs.vim.package]; - variables.EDITOR = mkOverride 100 "vim"; }; }; } -- cgit 1.4.1