From e0c71135d89d71d43e63164b9d2e42d19f54f886 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 29 Apr 2026 17:24:25 +0200 Subject: [PATCH] Add astro lsp --- flake.lock | 48 ++++++++++++++++++++-------------------- nvim/default.nix | 23 ++++++++++++++++++- nvim/lua/plugins/lsp.lua | 1 + nvim/nix/mknvim.nix | 3 +++ 4 files changed, 50 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index 6878e3c..3f0c99e 100644 --- a/flake.lock +++ b/flake.lock @@ -24,11 +24,11 @@ ] }, "locked": { - "lastModified": 1775087534, - "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", + "lastModified": 1777678872, + "narHash": "sha256-EPIFsulyon7Z1vLQq5Fk64GR8L7cQsT+IPhcsukVbgk=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", + "rev": "5250617bffd85403b14dbf43c3870e7f255d2c16", "type": "github" }, "original": { @@ -44,11 +44,11 @@ ] }, "locked": { - "lastModified": 1777389590, - "narHash": "sha256-HWbn7WASXsXGADiBDt6/k9U/HpGBEmoeqIOzrf+z2HE=", + "lastModified": 1777733408, + "narHash": "sha256-lyKV2GtkMPS1Mp8bKJ8sBr7LPCzL4GnVnQQYa4e7UsQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "8ec5a714dbbeb3fda00bd9758175555ebbad4d07", + "rev": "9ce9f7f128c5834bb71a4f5c62232187371379b6", "type": "github" }, "original": { @@ -106,11 +106,11 @@ ] }, "locked": { - "lastModified": 1777361204, - "narHash": "sha256-O5ZV2FJ0GfT1OXsbhVtLIRvz9chjhRddH+BHQ8A1C68=", + "lastModified": 1777681657, + "narHash": "sha256-LaHz8tExvJg1JT0RJubPjWffBWUmhX5uCQnIIbEp8SM=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "14adfd1c1a789e471abba7c56d4299f3ffd5ceb5", + "rev": "69942be4a5ffc37cd83f568ab5d1955721021eb5", "type": "github" }, "original": { @@ -122,11 +122,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1777332043, - "narHash": "sha256-nTHh5p4ADW0EohmB7//vcWYr1iUdNy6PVg+LCbOXx5I=", + "lastModified": 1777655539, + "narHash": "sha256-csYI4zuLVyrebqsvJilUkHe7GC4KHpl5pNzO+CiOPLE=", "owner": "neovim", "repo": "neovim", - "rev": "e4458b7f244b28a0f685552a4c20f0696f7e3f6c", + "rev": "085bb518c894a6b03aaf23ba81242c2c6126bea8", "type": "github" }, "original": { @@ -217,11 +217,11 @@ ] }, "locked": { - "lastModified": 1777394230, - "narHash": "sha256-So0O9VEARU3xTRIFkBtvfzpRDxx4W2WPZPgucxdKBm8=", + "lastModified": 1777732699, + "narHash": "sha256-2uX/XtOWZ/oy2rerRynVhqVA//ZXZ3Fo60PikLHEPQc=", "owner": "nix-community", "repo": "NixOS-WSL", - "rev": "d2e09229638f08f6d5c99060573f6fa4b1dde852", + "rev": "5482f113fd31ebac131d1ebeb2ae90bf0d5e41f5", "type": "github" }, "original": { @@ -264,11 +264,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1777270315, - "narHash": "sha256-yKB4G6cKsQsWN7M6rZGk6gkJPDNPIzT05y4qzRyCDlI=", + "lastModified": 1777641297, + "narHash": "sha256-WNGcmeOZ8Tr9dq6ztCspYbzWFswr2mPebM9LpsfGxPk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6368eda62c9775c38ef7f714b2555a741c20c72d", + "rev": "c6d65881c5624c9cae5ea6cedef24699b0c0a4c0", "type": "github" }, "original": { @@ -316,11 +316,11 @@ "tmux": { "flake": false, "locked": { - "lastModified": 1777388468, - "narHash": "sha256-X2+70PG5Vpu73bkyDmZsJg5l0axIcV/IAhuNNgIjoaQ=", + "lastModified": 1777647669, + "narHash": "sha256-5jt9Ph6byfsbq6x87mcoWr2AV1R11yyeZSsoT9a2g/0=", "owner": "tmux", "repo": "tmux", - "rev": "d85f1b942da3c451bdad1f2f794673a44b2d682c", + "rev": "9a94f48663b037aa348fa789c04b2d10628b0a9d", "type": "github" }, "original": { @@ -336,11 +336,11 @@ ] }, "locked": { - "lastModified": 1777352968, - "narHash": "sha256-BZ+BHCINHSyyCOWo4pCJQU4T994iZLiw7lgFMNw+W9k=", + "lastModified": 1777612697, + "narHash": "sha256-h+tXBNMDrsKbD1UnYw0IeSIT4RalHtIJ1GLOviib7/8=", "owner": "youwen5", "repo": "zen-browser-flake", - "rev": "bebce586893c7d441edd6cf9cf2cf62a1799361e", + "rev": "f9f70d14f9a57c7962c5cfe589461c1391044448", "type": "github" }, "original": { diff --git a/nvim/default.nix b/nvim/default.nix index 0382008..dac2957 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -5,6 +5,13 @@ ... }: let mkNvim = import ./nix/mknvim.nix {inherit pkgs lib;}; + astro-ls-wrapped = pkgs.runCommand "astro-language-server" { + nativeBuildInputs = [pkgs.makeWrapper]; + } '' + mkdir -p $out/bin + makeWrapper ${pkgs.astro-language-server}/bin/astro-ls $out/bin/astro-ls \ + --prefix NODE_PATH : "${pkgs.typescript}/lib/node_modules" + ''; # mkPlugin = src: pname: # (pkgs.vimUtils.buildVimPlugin # { @@ -113,7 +120,7 @@ in opencode-nvim nvim-unception ]; - opt = [ ]; + opt = []; }; extraPackages = with pkgs; [ @@ -140,6 +147,8 @@ in sqls biome tailwindcss-language-server + astro-ls-wrapped + typescript kdePackages.qtdeclarative # qmlls # gopls also needs go /shame @@ -161,4 +170,16 @@ in usql mono ]; + + extraConfig = + #lua + '' + vim.lsp.config['astro'] = { + init_options = { + typescript = { + tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib", + }, + }, + } + ''; } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 42414cc..1ec0955 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -21,6 +21,7 @@ vim.lsp.enable({ "sqls", "qmlls", "roslyn_ls", + "astro", }) -- vim.api.nvim_create_autocmd("LspAttach", { diff --git a/nvim/nix/mknvim.nix b/nvim/nix/mknvim.nix index dd56e9d..c346de0 100644 --- a/nvim/nix/mknvim.nix +++ b/nvim/nix/mknvim.nix @@ -5,6 +5,7 @@ }: { package ? pkgs.neovim, config, + extraConfig ? "", plugins ? { start = []; opt = []; @@ -84,6 +85,8 @@ } ${builtins.readFile (config + "/init.lua")} + + ${extraConfig} ''; in { nvim = pkgs.wrapNeovimUnstable nvim {