Skip to content

vimPlugins.coc-*: add npm dependencies#82578

Merged
adisbladis merged 3 commits intoNixOS:masterfrom
eyJhb:coc-npm
Mar 15, 2020
Merged

vimPlugins.coc-*: add npm dependencies#82578
adisbladis merged 3 commits intoNixOS:masterfrom
eyJhb:coc-npm

Conversation

@eyJhb
Copy link
Member

@eyJhb eyJhb commented Mar 14, 2020

Motivation for this change

These plugins do not work, without having the npm package, as it needs to be build beforehand.

Things done

Added all the npm packages that exists for the plugins.

Small snippets used at the bottom.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Things used to generated this

Find all current packages

$ cat pkgs/misc/vim-plugins/generated.nix | grep 'pname = "coc-' | sed -E 's/.*pname = "([^"]+)";/\1/g'

Output this to a file coc-vimplugins.txt.

#!/usr/bin/env bash
while read in; do
	curl --silent "https://www.npmjs.com/search?q=$in" | grep -i '0<!-- --> packages found' > /dev/null
	if [ $? -ne 0 ]; then
		echo $in
	#else
		#echo $in does not exists
	fi
done

OUtput to new file, then cat coc-vimplugins-npm.txt | xargs -I "{}" echo ', "{}"', and add to node-packagesv10.json.

Now override them all in vim-plugins-overrides.nix.

cat coc-vimplugins-npm.txt | xargs -I "{}" printf '  {} = buildVimPluginFrom2Nix {\n    pname = "{}";\n    version = nodePackages.{}.version;\n    src = "${nodePackages.{}}/lib/node_modules/{}";\n  };\n\n'

@adisbladis go go! ;)

@eyJhb eyJhb requested a review from jonringer as a code owner March 14, 2020 12:58
@ofborg ofborg bot added the 6.topic: vim Advanced text editor label Mar 14, 2020
Copy link
Contributor

Choose a reason for hiding this comment

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

apparently, this cannot be seen:

attribute 'coc-css' missing ... pkgs/misc/vim-plugins/overrides.nix:131:15

https://gist.github.com/GrahamcOfBorg/69f8e0bd962f1ce6fc88277a0d6fecce

@felschr
Copy link
Member

felschr commented Mar 15, 2020

I'm not sure if any of the added extensions in this PR require this but can I suggest adding the $HOME fix to this commit as well:
https://github.com/NixOS/nixpkgs/pull/72506/files#diff-a394ac424cb08e8ae710c7275ae578ff

Considering that this commit also adds coc-prettier, #72506 would then not be needed anymore.

UPDATE: Oh, it's just been merged.

@adisbladis
Copy link
Member

@felschr I'm in communications with @eyJhb on IRC and we're synchronising merges of related PRs. :)

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Mar 15, 2020
@adisbladis adisbladis merged commit 48b799e into NixOS:master Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: vim Advanced text editor 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants