So i’m trying to add a vim plugin ( GitHub - jannis-baum/vivify.vim: Live Markdown viewer for Vim and Neovim powered by Vivify · GitHub it’s just the vim package for GitHub - jannis-baum/Vivify: Live viewer for Markdown, HTML, Jupyter Notebooks & more · GitHub which is already in nixpkgs).
It’s my first time adding a package. From what I understodd, I need to
-
fork the repo (already did that)
-
clone it in my machine (already did that)
-
add the necessary files inside nixpkgs (where there is a probleme)
-
open a pull request
To understand how to add a package I used the following guides
In this guide i saw two commands that could help me: (this might be the same thing but the second just being a wrapper to the first one)
(1) nix-shell -p vimPluginsUpdater --run 'vim-plugins-updater add "jannis-baum/vivify.vim"'
(2) ./update.py add “jannis-baum/vivify.vim”
What happened with (1) :
(I placed myself in /nixpkgs/pkgs/applications/editors/vim/plugins)
It gave me this following error:
Traceback (most recent call last):
File “/nix/store/kyqz14cmsir4a1pv4mjlr3i1cw1wvwqg-vim-plugins-updater-0.1/bin/..vim-plugins-updater-wrapped-wrapped”, line 171, in
main()
~~~~^^
File “/nix/store/kyqz14cmsir4a1pv4mjlr3i1cw1wvwqg-vim-plugins-updater-0.1/bin/..vim-plugins-updater-wrapped-wrapped”, line 167, in main
editor.run()
~~~~~~~~~~^^
File “/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/`**`init`**`.py”, line 724, in run`
getattr(self, command)(args)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File “/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/`**`init`**`.py”, line 380, in add`
editor.rewrite_input(
~~~~~~~~~~~~~~~~~~~~^
fetch_config, args.input_file, editor.deprecated, append=append
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/`**`init`**`.py”, line 606, in rewrite_input`
return rewrite_input(*args, **kwargs)
File “/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/`**`init`**`.py”, line 893, in rewrite_input`
plugins = load_plugins_from_csv(config, input_file)
File “/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/`**`init`**`.py”, line 311, in load_plugins_from_csv`
with open(input_file, newline=“”) as csvfile:
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: ‘pkgs/applications/editors/vim/plugins/vim-plugin-names’
which was odd because the file did exist
I thought it might be a path issue. So i cd into /nixpkgs/ and rerun the command
path is '/nix/store/rg81b3sc4fmx4wa2lf0fwarf9kj4q3lm-99a1539a440633ee7a164e094a736c04acc2335d.tar.gz'
error:
… while calling the 'mapAttrs' builtin
at «string»:33:1:
32| in
33| lib.mapAttrs parse generated
| ^
34|
… while calling a functor (an attribute set with a '__functor' attribute)
at /home/tomasr/pkgs/nixpkgs/lib/customisation.nix:333:7:
332| if missingArgs == { } then
333| makeOverridable f allArgs
| ^
334| # This needs to be an abort so it can't be caught with `builtins.tryEval`,
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: function 'anonymous lambda' called with unexpected argument 'buildNeovimPlugin'
at /home/tomasr/pkgs/nixpkgs/pkgs/applications/editors/vim/plugins/generated.nix:2:1:
1| # GENERATED by ./pkgs/applications/editors/vim/plugins/utils/update.py. Do not edit!
2| {
| ^
3| lib,
Traceback (most recent call last):
File "/nix/store/kyqz14cmsir4a1pv4mjlr3i1cw1wvwqg-vim-plugins-updater-0.1/bin/..vim-plugins-updater-wrapped-wrapped", line 171, in <module>
main()
~~~~^^
File "/nix/store/kyqz14cmsir4a1pv4mjlr3i1cw1wvwqg-vim-plugins-updater-0.1/bin/..vim-plugins-updater-wrapped-wrapped", line 167, in main
editor.run()
~~~~~~~~~~^^
File "/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/__init__.py", line 724, in run
getattr(self, command)(args)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/__init__.py", line 389, in add
update = self.get_update(
args.input_file,
...<2 lines>...
[plugin.normalized_name],
)
File "/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/__init__.py", line 502, in get_update
current_plugins = self.get_current_plugins(config, self.nixpkgs)
File "/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/__init__.py", line 427, in get_current_plugins
data = run_nix_expr(self.get_plugins, nixpkgs)
File "/nix/store/dl2914y1nd40rv8vpxbsw2pb9sc9v2fk-python3.13-nixpkgs-plugin-update-0.1.0/lib/python3.13/site-packages/nixpkgs_plugin_update/__init__.py", line 342, in run_nix_expr
out = subprocess.check_output(cmd, **args)
File "/nix/store/f8xmcwbyw8am8ybkdvzsj0ln6mlr559i-python3-3.13.11/lib/python3.13/subprocess.py", line 472, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs).stdout
^^^^^^^^^
File "/nix/store/f8xmcwbyw8am8ybkdvzsj0ln6mlr559i-python3-3.13.11/lib/python3.13/subprocess.py", line 577, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['nix', 'eval', '--extra-experimental-features', 'nix-command', '--impure', '--json', '--expr', 'with import <localpkgs> { };\nlet\n inherit (vimUtils.override { inherit vim; }) buildVimPlugin;\n inherit (neovimUtils) buildNeovimPlugin;\n\n generated = callPackage <localpkgs/pkgs/applications/editors/vim/plugins/generated.nix> {\n inherit buildNeovimPlugin buildVimPlugin;\n } { } { };\n\n hasChecksum =\n value:\n lib.isAttrs value\n && lib.hasAttrByPath [\n "src"\n "outputHash"\n ] value;\n\n parse = name: value: {\n pname = value.pname;\n version = value.version;\n homePage = value.meta.homepage;\n checksum =\n if hasChecksum value then\n {\n submodules = value.src.fetchSubmodules or false;\n sha256 = value.src.outputHash;\n rev = value.src.rev;\n }\n else\n null;\n };\nin\nlib.mapAttrs parse generated\n', '--nix-path', 'localpkgs=/home/tomasr/pkgs/nixpkgs']' returned non-zero exit status 1.
I don’t remember why? but i tried to run nix-shell -p vimPluginsUpdater vimUtils --run 'vim-plugin-updater "jannis-baum/vivify.vim"' thinking some depency was just missing. It gave me this (different) error:
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/9hfp0agnm43kz72l5lpfn9var5p0x2fa-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/9hfp0agnm43kz72l5lpfn9var5p0x2fa-source/pkgs/stdenv/generic/make-derivation.nix:593:13:
592| depsHostHost = elemAt (elemAt dependencies 1) 0;
593| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
594| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Dependency is not of a valid type: element 2 of buildInputs for shell
At this point, i didn’t understood what was wrong so i wanted to try the second command i got in the guide.
So i placed my self in /nixpkgs/pkgs/applications/editors/vim/plugins and runned ./utils/update.py add "jannis-baum/vivify.vim"
I get this error:
Traceback (most recent call last):
File "/home/tomasr/pkgs/nixpkgs/pkgs/applications/editors/vim/plugins/./utils/update.py", line 33, in <module>
import nixpkgs_plugin_update
ModuleNotFoundError: No module named 'nixpkgs_plugin_update'
I think it’s probably misssing some dependecy:
so i run nix-shell -p vimPluginsUpdater vimUtils --run './utils/update.py add "jannis-baum/vivify.vim"' thinking the solution was just to add the same depencies as before. It gave me:
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'shell'
whose name attribute is located at /nix/store/9hfp0agnm43kz72l5lpfn9var5p0x2fa-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'buildInputs' of derivation 'shell'
at /nix/store/9hfp0agnm43kz72l5lpfn9var5p0x2fa-source/pkgs/stdenv/generic/make-derivation.nix:593:13:
592| depsHostHost = elemAt (elemAt dependencies 1) 0;
593| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
594| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: Dependency is not of a valid type: element 2 of buildInputs for shell
At this point i encountered the same error as before and did not knew what to do next.
So please, could someone help me? ![]()
When i get this going, i just should open a pull request to nixpkgs? or something else?
and how could i use the plugin between the time i do the pull request and the time it is accepted?