about summary refs log tree commit diff stats
path: root/modules/by-name/nv/nvim/plgs/lsp
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-23 14:23:38 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-23 14:23:38 +0100
commita9e4c74e7e5ffdf4e8eeab8d194fd71d0d6d122a (patch)
treed9b040d20de8fa54d4716871318e403a08abebcd /modules/by-name/nv/nvim/plgs/lsp
parenttests({modules,tests}): Delay the coupling, until more modules are tested (diff)
downloadnixos-config-a9e4c74e7e5ffdf4e8eeab8d194fd71d0d6d122a.tar.gz
nixos-config-a9e4c74e7e5ffdf4e8eeab8d194fd71d0d6d122a.zip
fix(modules/nvim/plgs/lsp/servers): Avoid conditional in `lsp.servers`
The attrs in `lsp.servers` seem to be taken literally and as such do not
support the `lib.modules.mkIf` mechanic, nixos normally supports.  Thus
moving the `lib.mkIf` calls to the parent attrs should fix it.
Diffstat (limited to 'modules/by-name/nv/nvim/plgs/lsp')
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix6
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix6
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix60
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix10
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix12
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix24
-rw-r--r--modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix8
7 files changed, 70 insertions, 56 deletions
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix
index 7d036a13..5a37e133 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/bashls.nix
@@ -5,7 +5,9 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    bashls.enable = true;
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      bashls.enable = true;
+    };
   };
 }
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix
index cd7229bc..9f3195fa 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ccls.nix
@@ -5,7 +5,9 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    ccls.enable = true;
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      ccls.enable = true;
+    };
   };
 }
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix
index c89e0790..03b7d4c1 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/ltex.nix
@@ -5,39 +5,41 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    ltex = let
-      filetypes = [
-        "java"
-        "cpp"
-        "shell"
-        "bash"
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      ltex = let
+        filetypes = [
+          "java"
+          "cpp"
+          "shell"
+          "bash"
 
-        "bibtex"
-        "context"
-        "context.tex"
-        "latex"
-        "tex"
+          "bibtex"
+          "context"
+          "context.tex"
+          "latex"
+          "tex"
 
-        "markdown"
-        "org"
-        "restructuredtext"
-        "rsweave"
+          "markdown"
+          "org"
+          "restructuredtext"
+          "rsweave"
 
-        "git-commit"
-        "gitcommit"
+          "git-commit"
+          "gitcommit"
 
-        "mail"
-      ];
-    in {
-      enable = true;
-      inherit filetypes;
-      settings = {
-        enabled = filetypes;
-        completionEnabled = false;
-        language = "en-CA";
-        additionalRules = {
-          enablePickyRules = true;
+          "mail"
+        ];
+      in {
+        enable = true;
+        inherit filetypes;
+        settings = {
+          enabled = filetypes;
+          completionEnabled = false;
+          language = "en-CA";
+          additionalRules = {
+            enablePickyRules = true;
+          };
         };
       };
     };
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix
index f2e553f1..39e4b989 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/lua-ls.nix
@@ -5,10 +5,12 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    lua_ls = {
-      enable = true;
-      settings.telemetry.enable = false;
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      lua_ls = {
+        enable = true;
+        settings.telemetry.enable = false;
+      };
     };
   };
 }
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix
index 9c760345..94ca99ce 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/nil-ls.nix
@@ -5,11 +5,13 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    nil_ls = {
-      enable = true;
-      settings = {
-        formatting.command = ["alejandra"];
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      nil_ls = {
+        enable = true;
+        settings = {
+          formatting.command = ["alejandra"];
+        };
       };
     };
   };
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix
index 01cd11f4..093f5250 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/rust-analyzer.nix
@@ -5,19 +5,21 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    rust_analyzer = {
-      enable = true;
-      settings = {
-        typing.autoClosingAngleBrackets.enable = true;
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      rust_analyzer = {
+        enable = true;
+        settings = {
+          typing.autoClosingAngleBrackets.enable = true;
 
-        # Check with `cargo clippy` instead of just `cargo check`
-        check.command = "clippy";
+          # Check with `cargo clippy` instead of just `cargo check`
+          check.command = "clippy";
+        };
+        # NOTE: These should be provided by the devenv, to support nightly and
+        # such things <2023-11-25>
+        installCargo = false;
+        installRustc = false;
       };
-      # NOTE: These should be provided by the devenv, to support nightly and
-      # such things <2023-11-25>
-      installCargo = false;
-      installRustc = false;
     };
   };
 }
diff --git a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix
index 3f91beb5..1fe3c764 100644
--- a/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix
+++ b/modules/by-name/nv/nvim/plgs/lsp/servers/servers/texlab.nix
@@ -5,9 +5,11 @@
 }: let
   cfg = config.soispha.programs.nvim;
 in {
-  home-manager.users.soispha.programs.nixvim.plugins.lsp.servers = lib.mkIf cfg.enable {
-    texlab = {
-      enable = true;
+  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    plugins.lsp.servers = {
+      texlab = {
+        enable = true;
+      };
     };
   };
 }