Selaa lähdekoodia

simplify lsp configuration (#2)

* chore(deps): update flake.lock
* refactor(nvim/lsp): simplify lsp configuration fixes #1
* feat(cli/git): add codeberg-cli and apply aesir git config to ravn

Reviewed-on: https://codeberg.org/control/home/pulls/2
Co-authored-by: Zander Hawke <[email protected]>
Co-committed-by: Zander Hawke <[email protected]>
Zander Hawke 10 kuukautta sitten
vanhempi
sitoutus
30120e5076
3 muutettua tiedostoa jossa 50 lisäystä ja 57 poistoa
  1. 19 19
      flake.lock
  2. 24 11
      home/features/cli/git.nix
  3. 7 27
      home/features/nvim/lsp.nix

+ 19 - 19
flake.lock

@@ -123,11 +123,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1753121425,
-        "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
+        "lastModified": 1754091436,
+        "narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=",
         "owner": "hercules-ci",
         "repo": "flake-parts",
-        "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
+        "rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd",
         "type": "github"
       },
       "original": {
@@ -209,11 +209,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1754174776,
-        "narHash": "sha256-Sp3FRM6xNwNtGzYH/HByjzJYHSQvwsW+lDMMZNF43PQ=",
+        "lastModified": 1754263839,
+        "narHash": "sha256-ck7lILfCNuunsLvExPI4Pw9OOCJksxXwozum24W8b+8=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "e6e2f43a62b7dbc8aa8b1adb7101b0d8b9395445",
+        "rev": "1d7abbd5454db97e0af51416f4960b3fb64a4773",
         "type": "github"
       },
       "original": {
@@ -327,11 +327,11 @@
     },
     "nixpkgs-darwin": {
       "locked": {
-        "lastModified": 1754064298,
-        "narHash": "sha256-51/xBGL1NyXabL+8o+22NGBP40+8qMgoxm22M0ojrQA=",
+        "lastModified": 1754240291,
+        "narHash": "sha256-zjNsbAWuIaeJPHq7YFXkYqyMa7iAAEukQwYZfP/LXHw=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "6084e5b53c5f2d17132eef59f91cda7eb271449a",
+        "rev": "3535321020f5617f3ca73065118984b1325331ab",
         "type": "github"
       },
       "original": {
@@ -343,11 +343,11 @@
     },
     "nixpkgs-unstable": {
       "locked": {
-        "lastModified": 1754151594,
-        "narHash": "sha256-S30TWshtDmNlU30u842RidFUraKj1f2dd4nrKRHm3gE=",
+        "lastModified": 1754278406,
+        "narHash": "sha256-jvIQTMN5EzoOP5RaGztpVese8a3wqy0M/h6tNzycW28=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "7b6929d8b900de3142638310f8bc40cff4f2c507",
+        "rev": "6a489c9482ca676ce23c0bcd7f2e1795383325fa",
         "type": "github"
       },
       "original": {
@@ -367,11 +367,11 @@
         "systems": "systems_2"
       },
       "locked": {
-        "lastModified": 1753534875,
-        "narHash": "sha256-U8eKkKR+c70Sj+XuhbCzRAWJBfRLEF7Qh7gKk/7f93M=",
+        "lastModified": 1754262585,
+        "narHash": "sha256-Yz5dJ0VzGRzSRHdHldsWQbuFYmtP3NWNreCvPfCi9CI=",
         "owner": "nix-community",
         "repo": "nixvim",
-        "rev": "f25f269dddf2e464f0d4a79bb42b6bfbab63b0df",
+        "rev": "ab1b5962e1ca90b42de47e1172e0d24ca80e6256",
         "type": "github"
       },
       "original": {
@@ -391,11 +391,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1753450833,
+        "lastModified": 1753771532,
         "narHash": "sha256-Pmpke0JtLRzgdlwDC5a+aiLVZ11JPUO5Bcqkj0nHE/k=",
         "owner": "NuschtOS",
         "repo": "search",
-        "rev": "40987cc1a24feba378438d691f87c52819f7bd75",
+        "rev": "2a65adaf2c0c428efb0f4a2bc406aab466e96a06",
         "type": "github"
       },
       "original": {
@@ -454,11 +454,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1754193284,
+        "lastModified": 1754321100,
         "narHash": "sha256-ZGLXnpXy7vcTDLC1yLQSJOclsilvK+RNFVVEeO0ei/0=",
         "owner": "0xc000022070",
         "repo": "zen-browser-flake",
-        "rev": "ac2b25e76f5bfe1e30ae39409dfa450c5c1bc945",
+        "rev": "39839af0ce884ba60231dfbcc68a58a084c1c02a",
         "type": "github"
       },
       "original": {

+ 24 - 11
home/features/cli/git.nix

@@ -1,6 +1,23 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
 
-  home.packages = with pkgs; [ git-crypt ];
+let
+  aesir = {
+    core.sshCommand = "ssh -i ~/.ssh/id_aesirdev";
+    user = {
+      email = "[email protected]";
+      name = "Æsir Dev";
+      signingKey = "58145313C9636027";
+    };
+    commit.gpgSign = true;
+  };
+in
+
+{
+
+  home.packages = with pkgs; [
+    git-crypt
+    codeberg-cli
+  ];
 
   programs.git = {
     enable = true;
@@ -10,15 +27,11 @@
     includes = [
       {
         condition = "gitdir/i:~/workspace/aesir/**";
-        contents = {
-          core.sshCommand = "ssh -i ~/.ssh/id_aesirdev";
-          user = {
-            email = "[email protected]";
-            name = "Æsir Dev";
-            signingKey = "58145313C9636027";
-          };
-          commit.gpgSign = true;
-        };
+        contents = aesir;
+      }
+      {
+        condition = "gitdir/i:~/workspace/ravn/**";
+        contents = aesir;
       }
     ];
 

+ 7 - 27
home/features/nvim/lsp.nix

@@ -127,43 +127,23 @@
       servers = {
         astro.enable = true;
         bashls.enable = true;
-
         denols = {
           enable = true;
-          extraOptions.init_options = {
-            lint = true;
-            unstable = true;
-            root_dir.__raw = ''
-              require("lspconfig.util").root_pattern("deno.json", "deno.jsonc", "deno.lock")
-            '';
-          };
+          extraOptions.root_dir.__raw = ''
+            require("lspconfig.util").root_pattern("deno.json", "deno.jsonc", "deno.lock")
+          '';
         };
-
         gopls.enable = true;
-
         nextls.enable = true;
         nil_ls.enable = true;
         tailwindcss.enable = true;
-
         ts_ls = {
           enable = true;
-          extraOptions = {
-            single_file_support = false;
-            root_dir.__raw = ''
-              function(fname)
-                local util = require("lspconfig.util")
-                local deno_root = util.root_pattern("deno.json", "deno.jsonc", "deno.lock")(fname)
-
-                if deno_root then
-                  return nil
-                end
-
-                return util.root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")(fname)
-              end
-            '';
-          };
+          extraOptions.root_dir.__raw = ''
+            require("lspconfig.util").root_pattern("tsconfig.json", "jsconfig.json")
+          '';
+          extraOptions.single_file_support = false;
         };
-
         volar.enable = true;
       };
     };