diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
commit | e6ed60548397627bf10f561f9438201dbba0a36e (patch) | |
tree | f9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/nixos/vim/default.nix | |
parent | 2024-04-18 (diff) |
2024-04-21
Diffstat (limited to '')
-rw-r--r-- | modules/vim/default.nix (renamed from modules/nixos/vim/default.nix) | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/nixos/vim/default.nix b/modules/vim/default.nix index 5d62e35..94cc7af 100644 --- a/modules/nixos/vim/default.nix +++ b/modules/vim/default.nix @@ -9,7 +9,33 @@ 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; @@ -33,5 +59,13 @@ in packages.myVimPackage.start = plugins; }; }; + + environment = { + systemPackages = [ config.programs.vim.package ]; + variables = rec { + EDITOR = "vim"; + VISUAL = EDITOR; + }; + }; }; } |