Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/misc/vim-plugins/generated.nix
Expand Up @@ -2591,6 +2591,17 @@ let
meta.homepage = "https://github.com/norcalli/nvim-terminal.lua/";
};

nvim-typescript = buildVimPluginFrom2Nix {
pname = "nvim-typescript";
version = "2020-06-06";
src = fetchFromGitHub {
owner = "mhartington";
repo = "nvim-typescript";
rev = "cb325b5273e1eba4e8536fdf211a4d7e49b5d6f9";
sha256 = "0bbbj25jhdx0ls2d7p9ir54hmdxvql9kn3hid1s4h963ww1mah0j";
};
};

nvim-yarp = buildVimPluginFrom2Nix {
pname = "nvim-yarp";
version = "2020-04-08";
Expand Down
33 changes: 31 additions & 2 deletions pkgs/misc/vim-plugins/overrides.nix
@@ -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
Expand All @@ -10,7 +10,7 @@
, languagetool
, Cocoa, CoreFoundation, CoreServices
, buildVimPluginFrom2Nix
, nodePackages
, nodePackages, nodejs
, dasht

# coc-go dependency
Expand Down Expand Up @@ -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
''
) {});
Comment on lines +716 to +731
Copy link
Contributor

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

Suggested change
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
''
) {});
nvim-typescript-deps = 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
'';

Copy link
Contributor

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.

Copy link
Contributor Author

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.

in
super.nvim-typescript.overrideAttrs(old: {
buildInputs = [ nodejs ];
Copy link
Contributor

Choose a reason for hiding this comment

The 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
buildInputs = [ nodejs ];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs nodejs to run npm run build though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it should in nativeBuildInputs :)

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 \
Expand Down
1 change: 1 addition & 0 deletions pkgs/misc/vim-plugins/vim-plugin-names
Expand Up @@ -282,6 +282,7 @@ megaannum/self
mengelbrecht/lightline-bufferline
mfukar/robotframework-vim
mg979/vim-visual-multi
mhartington/nvim-typescript
mhinz/vim-grepper
mhinz/vim-janah
mhinz/vim-sayonara
Expand Down