NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.32k stars 14.29k forks source link

Package request: twig-language-server #354492

Closed IceDBorn closed 1 day ago

IceDBorn commented 2 weeks ago

Project description Language server for Twig templates.

Metadata


Add a :+1: reaction to issues you find important.

genga898 commented 2 weeks ago

I built a derivation of it, could you test and see if it works

{
  lib,
  fetchFromGitHub,
  buildNpmPackage,
}:

buildNpmPackage rec {
  pname = "twig-language-server";
  version = "0.5.1";

  src = fetchFromGitHub {
    owner = "kaermorchen";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-bW0siZudzqk/4XgVH6nNCOrpJ6WHTCZoHJC+aXnE5mM=";
  };

  npmDepsHash = "sha256-zbMjfdIXQf6oz6em0vkyvroijCb2MUioZjvZjkbuKc8=";

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    mkdir -p $out/node_modules
    mkdir -p $out/packages
    chmod +x $out/bin
    chmod +x $out/node_modules

    cp -R ./node_modules/twig-language-server $out/bin
    cp -R ./packages $out/
    cp -R ./node_modules/* $out/node_modules
    runHook postInstall
  '';

}