From 4301c5810b2167afa952706dd1f71a0705b8e712 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Fri, 17 Nov 2023 20:27:40 -0800 Subject: [PATCH] Try using nix-provided nodehun --- codedown.nix | 2 +- .../markdown-spellcheck-lsp/default.nix | 58 +++---------------- 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/codedown.nix b/codedown.nix index 36f49a66..18e8504c 100644 --- a/codedown.nix +++ b/codedown.nix @@ -47,7 +47,7 @@ rec { nixpkgsStableSearcher = common.searcher pkgsStable; - spellchecker = callPackage ./language_servers/markdown-spellcheck-lsp {}; + spellchecker = pkgsUnstable.callPackage ./language_servers/markdown-spellcheck-lsp {}; shells = { zsh = callPackage ./shells/zsh {}; diff --git a/language_servers/markdown-spellcheck-lsp/default.nix b/language_servers/markdown-spellcheck-lsp/default.nix index fd2ce498..aa57c14d 100644 --- a/language_servers/markdown-spellcheck-lsp/default.nix +++ b/language_servers/markdown-spellcheck-lsp/default.nix @@ -1,17 +1,21 @@ -{ lib -, callPackage +{ callPackage , fetchFromGitHub +, lib +, makeWrapper +, runCommand +, stdenv + , hunspell , hunspellDicts , hunspellWithDicts -, makeWrapper + , node2nix , nodePackages +, nodehun , nodejs-18_x , nodejs-slim-18_x + , python3 -, stdenv -, runCommand , unixtools }: @@ -22,27 +26,6 @@ let nodejs = nodejs-slim-18_x; - nodehunWithNix = stdenv.mkDerivation { - name = "nodehun-with-nix"; - src = fetchFromGitHub { - owner = "Wulf"; - repo = "nodehun"; - rev = "03c9dcf1fcd965031a68553ccaf6487d1fe87f79"; - sha256 = "13baqdxq8m1rvcqpdx5kwwk32xppwv9k29d2w55ash48akk3v1ij"; - }; - - dontConfigure = true; - dontFixup = true; - - doCheck = false; - - buildInputs = [node2nix]; - - buildPhase = "node2nix -18 -l package-lock.json"; - - installPhase = "cp -r ./. $out"; - }; - nodeHeaders = runCommand "node-${nodejs.version}-headers.tar.gz" { buildInputs = []; } '' dir="node-v${nodejs.version}" mkdir "$dir" @@ -50,29 +33,6 @@ let tar -czvf $out "$dir" ''; - nodehun = (callPackage nodehunWithNix { nodejs = nodejs-18_x; }).package.override { - preRebuild = '' - npm run build -- --tarball ${nodeHeaders} - ''; - - buildInputs = [python3 nodePackages.node-gyp stdenv]; - - disallowedReferences = [ nodejs ]; - - postInstall = '' - # Only keep the necessary parts of build/Release to reduce closure size - cd $out/lib/node_modules/nodehun - mv build build_old - mkdir build - cp -r build_old/Release build/ - rm -rf build_old - rm -rf build/Release/.deps - - # Remove a development script to eliminate runtime dependency on node - rm node_modules/node-addon-api/tools/conversion.js - ''; - }; - indexJs = stdenv.mkDerivation { name = "markdown-spellcheck-lsp-index.js";