about summary refs log tree commit diff
path: root/modules/nixos/vim
diff options
context:
space:
mode:
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;
+      };
+    };
   };
 }

Consider giving Nix/NixOS a try! <3