summaryrefslogtreecommitdiff
path: root/modules/vim/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-04-21 02:15:42 +0300
committerAzat Bahawi <azat@bahawi.net>2024-04-21 02:15:42 +0300
commite6ed60548397627bf10f561f9438201dbba0a36e (patch)
treef9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/vim/default.nix
parent9ac64328603d44bd272175942d3ea3eaadcabd04 (diff)
2024-04-21
Diffstat (limited to 'modules/vim/default.nix')
-rw-r--r--modules/vim/default.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/modules/vim/default.nix b/modules/vim/default.nix
new file mode 100644
index 0000000..94cc7af
--- /dev/null
+++ b/modules/vim/default.nix
@@ -0,0 +1,71 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib;
+let
+ cfg = config.nixfiles.modules.vim;
+in
+{
+ 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 {
+ hm.stylix.targets.vim.enable = false;
+
+ programs.vim.package =
+ (pkgs.vim-full.override {
+ cscopeSupport = false;
+ darwinSupport = false;
+ features = "normal";
+ guiSupport = "gtk3";
+ luaSupport = false;
+ multibyteSupport = false;
+ netbeansSupport = false;
+ nlsSupport = false;
+ perlSupport = false;
+ pythonSupport = false;
+ rubySupport = false;
+ tclSupport = false;
+ ximSupport = false;
+ }).customize
+ {
+ name = "vim";
+ vimrcConfig = with cfg; {
+ customRC = rc;
+ packages.myVimPackage.start = plugins;
+ };
+ };
+
+ environment = {
+ systemPackages = [ config.programs.vim.package ];
+ variables = rec {
+ EDITOR = "vim";
+ VISUAL = EDITOR;
+ };
+ };
+ };
+}