New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vimPlugins.nvim-typescript: Init at 2020-06-06 #89553
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,5 +1,5 @@ | ||||
{ lib, stdenv | ||||
, python, cmake, meson, vim, ruby | ||||
, python, cmake, meson, vim, ruby, callPackage, runCommand | ||||
, which, fetchFromGitHub, fetchgit, fetchurl, fetchzip, fetchpatch | ||||
, llvmPackages, rustPlatform | ||||
, xkb-switch, fzf, skim, stylish-haskell | ||||
|
@@ -10,7 +10,7 @@ | |||
, languagetool | ||||
, Cocoa, CoreFoundation, CoreServices | ||||
, buildVimPluginFrom2Nix | ||||
, nodePackages | ||||
, nodePackages, nodejs | ||||
, dasht | ||||
|
||||
# coc-go dependency | ||||
|
@@ -711,6 +711,35 @@ self: super: { | |||
dependencies = with super; [ bclose-vim ]; | ||||
}); | ||||
|
||||
nvim-typescript = let | ||||
# node2nix dynamically resolves nodeDependencies | ||||
nvim-typescript-deps = (callPackage ( | ||||
runCommand "nvim-typescript-rplugin.nix" { | ||||
buildInputs = [ nodePackages.node2nix ]; | ||||
} '' | ||||
mkdir -p $out | ||||
cd ${super.nvim-typescript.src}/rplugin/node/nvim_typescript | ||||
node2nix --input package.json \ | ||||
--lock package-lock.json \ | ||||
--include-peer-dependencies \ | ||||
--nodejs-10 \ | ||||
--development \ | ||||
--output $out/node-packages.nix \ | ||||
--node-env $out/node-env.nix \ | ||||
--composition $out/default.nix | ||||
'' | ||||
) {}); | ||||
in | ||||
super.nvim-typescript.overrideAttrs(old: { | ||||
buildInputs = [ nodejs ]; | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this probably isn't needed, as it won't be available at runtime
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs nodejs to run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then it should in |
||||
buildPhase = '' | ||||
pushd rplugin/node/nvim_typescript | ||||
cp -r ${nvim-typescript-deps.shell.nodeDependencies}/lib/node_modules node_modules | ||||
npm run build | ||||
popd | ||||
''; | ||||
}); | ||||
|
||||
vim-stylish-haskell = super.vim-stylish-haskell.overrideAttrs (old: { | ||||
postPatch = old.postPatch or "" + '' | ||||
substituteInPlace ftplugin/haskell/stylish-haskell.vim --replace \ | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should fix your evaluation error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, now that I look at this again, I'm not sure this is correct either. I'm not familiar with using node within nix to give you affirmative answer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think this is not going to work without committing a generated node2nix file.