bunch of vscode changes + add luau-lsp package

This commit is contained in:
cswimr 2025-01-11 18:09:03 -06:00
parent 6cc838119d
commit 20f42f88d5
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 467 additions and 415 deletions

View file

@ -28,15 +28,22 @@ rec {
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
stylua
rojo
(pkgs.callPackage ../packages/luau-lsp.nix { inherit pkgs; })
powershell powershell
ruff ruff
ruff-lsp ruff-lsp
]; ];
programs.vscode = let dotnettools = import inputs.dotnettoolsVscodeExtensions { programs.vscode =
let
dotnettools = import inputs.dotnettoolsVscodeExtensions {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
}; in { };
in
{
enable = true; enable = true;
enableUpdateCheck = false; enableUpdateCheck = false;
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;
@ -83,6 +90,7 @@ rec {
patcx.vscode-nuget-gallery patcx.vscode-nuget-gallery
corylulu.csharp-interpolated-string-converter corylulu.csharp-interpolated-string-converter
adrianwilczynski.asp-net-core-switcher adrianwilczynski.asp-net-core-switcher
kevin-chatham.aspnetcorerazor-html-css-class-completion
adrianwilczynski.blazor-snippet-pack adrianwilczynski.blazor-snippet-pack
adrianwilczynski.csharp-to-typescript adrianwilczynski.csharp-to-typescript
adrianwilczynski.namespace adrianwilczynski.namespace
@ -107,10 +115,8 @@ rec {
# Luau # Luau
evaera.vscode-rojo evaera.vscode-rojo
undermywheel.roblox-lua
johnnymorganz.stylua johnnymorganz.stylua
johnnymorganz.luau-lsp johnnymorganz.luau-lsp
nightrains.robloxlsp
# Go # Go
pkgs.vscode-extensions.golang.go pkgs.vscode-extensions.golang.go
@ -291,6 +297,7 @@ rec {
}; };
}; };
"ruff.path" = [ "${pkgs.ruff}/bin/ruff" ]; "ruff.path" = [ "${pkgs.ruff}/bin/ruff" ];
"luau-lsp.serverPath" = "${pkgs.callPackage ../packages/luau-lsp.nix { inherit pkgs; }}/bin/luau-lsp";
"python.terminal.activateEnvironment" = false; "python.terminal.activateEnvironment" = false;
"python.terminal.activateEnvInCurrentTerminal" = false; "python.terminal.activateEnvInCurrentTerminal" = false;
"[csharp]" = { "[csharp]" = {
@ -337,8 +344,12 @@ rec {
"vscord.status.image.small.idle.key" = "https://vscord.catppuccin.com/mocha/idle.webp"; "vscord.status.image.small.idle.key" = "https://vscord.catppuccin.com/mocha/idle.webp";
"vscord.status.image.small.notInFile.key" = "https://vscord.catppuccin.com/mocha/idle.webp"; "vscord.status.image.small.notInFile.key" = "https://vscord.catppuccin.com/mocha/idle.webp";
"vscord.status.image.small.viewing.key" = "https://vscord.catppuccin.com/mocha/{app_id}.webp"; "vscord.status.image.small.viewing.key" = "https://vscord.catppuccin.com/mocha/{app_id}.webp";
"stylua.styluaPath" = "${pkgs.stylua}/bin/stylua";
"git.enableSmartCommit" = true; "git.enableSmartCommit" = true;
"git.autofetch" = true; "git.autofetch" = true;
"luau-lsp.sourcemap.autogenerate" = true;
"luau-lsp.completion.autocompleteEnd" = true;
"luau-lsp.sourcemap.rojoPath" = "${pkgs.rojo}/bin/rojo";
"git.confirmSync" = false; "git.confirmSync" = false;
"security.workspace.trust.untrustedFiles" = "open"; "security.workspace.trust.untrustedFiles" = "open";
"files.insertFinalNewline" = true; "files.insertFinalNewline" = true;

41
packages/luau-lsp.nix Normal file
View file

@ -0,0 +1,41 @@
{ pkgs, lib, ...
}:
pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "luau-lsp";
version = "1.38.0";
src = pkgs.fetchFromGitHub {
owner = "JohnnyMorganz";
repo = "luau-lsp";
rev = finalAttrs.version;
hash = "sha256-31EdtCQftxhpp2b7fpM5XqRh+r0rBE/k9SpYEPpGpV0=";
fetchSubmodules = true;
};
nativeBuildInputs = [ pkgs.cmake ]
++ lib.optional pkgs.stdenv.isLinux pkgs.gcc9;
buildPhase = ''
runHook preBuild
cmake ..
cmake --build . --target Luau.LanguageServer.CLI --config Release
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ./luau-lsp $out/bin/luau-lsp
runHook postInstall
'';
meta = {
description = "Language Server for Luau";
homepage = "https://github.com/JohnnyMorganz/luau-lsp";
downloadPage = "https://github.com/JohnnyMorganz/luau-lsp/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ cswimr ];
mainProgram = "luau-lsp";
};
})