about summary refs log tree commit diff
path: root/pkgs/by-name/st/stylelint-lsp/package.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2024-06-26 00:02:13 +0000
committerGitHub <noreply@github.com>2024-06-26 00:02:13 +0000
commit27074b7d078ee7f554bc623756c23914939f3c4b (patch)
tree161bd8a7590e7c229814877667330d5fe35d2edd /pkgs/by-name/st/stylelint-lsp/package.nix
parent08b5c3c46ad3ffd4e31332f69d816004c529b82a (diff)
parent260616a5fddf0d3cf41bca8b74be23e2e2bf8c2e (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/by-name/st/stylelint-lsp/package.nix')
-rw-r--r--pkgs/by-name/st/stylelint-lsp/package.nix61
1 files changed, 61 insertions, 0 deletions
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;
+  };
+})