summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2023-03-14 20:50:09 +0100
committerAlan Pearce2023-03-14 20:50:09 +0100
commit69dba9ad76730fa435a797e1586231c78d189d54 (patch)
tree4a0bb6c9ba2ac066dcd55318ed474cd689ecab40 /user
parent96b814111069b36c1c7a4395348e4af41d336bcc (diff)
downloadnixfiles-69dba9ad76730fa435a797e1586231c78d189d54.tar.lz
nixfiles-69dba9ad76730fa435a797e1586231c78d189d54.tar.zst
nixfiles-69dba9ad76730fa435a797e1586231c78d189d54.zip
Extract neovim config to own file
Diffstat (limited to 'user')
-rw-r--r--user/settings/base.nix31
-rw-r--r--user/settings/neovim.nix35
2 files changed, 38 insertions, 28 deletions
diff --git a/user/settings/base.nix b/user/settings/base.nix
index 2dc51936..7c785681 100644
--- a/user/settings/base.nix
+++ b/user/settings/base.nix
@@ -4,39 +4,14 @@
   pkgs,
   ...
 }: {
+  imports = [
+    ./neovim.nix
+  ];
   # Let Home Manager install and manage itself.
   programs.home-manager.enable = true;
   manual = {
     html.enable = true;
   };
-  programs.neovim = {
-    enable = true;
-    vimAlias = true;
-    vimdiffAlias = true;
-    withNodeJs = true;
-    plugins = with pkgs.vimPlugins; [
-      commentary
-      coc-git
-      coc-json
-      coc-tabnine
-      coc-yaml
-      vim-surround
-    ];
-    extraLuaConfig = builtins.readFile ../nvim/init.lua;
-    coc = {
-      enable = true;
-      settings = {
-        "json.enable" = true;
-        "suggest.enablePreview" = true;
-        languageserver = {
-          nix = {
-            command = "${pkgs.nil}/bin/nil";
-            filetypes = [ "nix" ];
-          };
-        };
-      };
-    };
-  };
   home.sessionVariables = {
     EMAIL = "alan@alanpearce.eu";
     XDG_CACHE_HOME =
diff --git a/user/settings/neovim.nix b/user/settings/neovim.nix
new file mode 100644
index 00000000..108b51a7
--- /dev/null
+++ b/user/settings/neovim.nix
@@ -0,0 +1,35 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}: {
+  programs.neovim = {
+    enable = true;
+    vimAlias = true;
+    vimdiffAlias = true;
+    withNodeJs = true;
+    plugins = with pkgs.vimPlugins; [
+      commentary
+      coc-git
+      coc-json
+      coc-tabnine
+      coc-yaml
+      vim-surround
+    ];
+    extraLuaConfig = builtins.readFile ../nvim/init.lua;
+    coc = {
+      enable = true;
+      settings = {
+        "json.enable" = true;
+        "suggest.enablePreview" = true;
+        languageserver = {
+          nix = {
+            command = "${pkgs.nil}/bin/nil";
+            filetypes = [ "nix" ];
+          };
+        };
+      };
+    };
+  };
+}