From 360fecb837f41ef56e05614022a85531539576a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Fri, 23 Feb 2024 12:05:06 +0100 Subject: [PATCH] stylelint-lsp: init at 2.0.0 --- pkgs/by-name/st/stylelint-lsp/package.nix | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pkgs/by-name/st/stylelint-lsp/package.nix diff --git a/pkgs/by-name/st/stylelint-lsp/package.nix b/pkgs/by-name/st/stylelint-lsp/package.nix new file mode 100644 index 0000000000000..2bf7195d83c9e --- /dev/null +++ b/pkgs/by-name/st/stylelint-lsp/package.nix @@ -0,0 +1,61 @@ +{ + bash, + fetchFromGitHub, + lib, + nodejs, + pnpm_9, + stdenvNoCC, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "stylelint-lsp"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "bmatcuk"; + repo = "stylelint-lsp"; + rev = "v${finalAttrs.version}"; + hash = "sha256-mzhY6MKkXb1jFYZvs/VkGipBjBfUY3GukICb9qVQI80="; + }; + + nativeBuildInputs = [ + nodejs + pnpm_9.configHook + ]; + + pnpmDeps = pnpm_9.fetchDeps { + inherit (finalAttrs) pname version src; + hash = "sha256-/QJ4buPOt5KFJxwsQp7L9WYE1RtODj4LMq21l99QwhA="; + }; + + buildPhase = '' + runHook preBuild + + pnpm build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/{bin,lib/${finalAttrs.pname}} + mv {dist,node_modules} $out/lib/${finalAttrs.pname} + echo " + #!${lib.getExe bash} + ${lib.getExe nodejs} $out/lib/${finalAttrs.pname}/dist/index.js \$@ + " > $out/bin/stylelint-lsp + chmod +x $out/bin/stylelint-lsp + + runHook postInstall + ''; + + meta = with lib; { + description = "A stylelint Language Server"; + homepage = "https://github.com/bmatcuk/stylelint-lsp"; + license = licenses.mit; + maintainers = with maintainers; [ gepbird ]; + mainProgram = "stylelint-lsp"; + platforms = platforms.unix; + }; +})