···11-{ lib
22-, stdenv
33-, lua
44-, toVimPlugin
11+{
22+ lib,
33+ lua,
44+ toVimPlugin,
55}:
66let
77 # sanitizeDerivationName
88 normalizeName = lib.replaceStrings [ "." ] [ "-" ];
99in
10101111- # function to create vim plugin from lua packages that are already packaged in
1212- # luaPackages
1313- {
1414- # the lua derivation to convert into a neovim plugin
1515- luaAttr ? (lua.pkgs.${normalizeName attrs.pname})
1616- , ...
1717- }@attrs:
1818- let
1919- originalLuaDrv = if (lib.typeOf luaAttr == "string") then
2020- lib.warn "luaAttr as string is deprecated since September 2024. Pass a lua derivation directly ( e.g., `buildNeovimPlugin { luaAttr = lua.pkgs.plenary-nvim; }`)" lua.pkgs.${normalizeName luaAttr}
2121- else luaAttr;
1111+# function to create vim plugin from lua packages that are already packaged in
1212+# luaPackages
1313+{
1414+ # the lua derivation to convert into a neovim plugin
1515+ luaAttr ? (lua.pkgs.${normalizeName attrs.pname}),
1616+ ...
1717+}@attrs:
1818+let
1919+ originalLuaDrv =
2020+ if (lib.typeOf luaAttr == "string") then
2121+ lib.warn
2222+ "luaAttr as string is deprecated since September 2024. Pass a lua derivation directly ( e.g., `buildNeovimPlugin { luaAttr = lua.pkgs.plenary-nvim; }`)"
2323+ lua.pkgs.${normalizeName luaAttr}
2424+ else
2525+ luaAttr;
22262727+ luaDrv = originalLuaDrv.overrideAttrs (oa: {
2828+ version = attrs.version or oa.version;
2929+ rockspecVersion = oa.rockspecVersion;
23302424- luaDrv = originalLuaDrv.overrideAttrs (oa: {
2525- version = attrs.version or oa.version;
2626- rockspecVersion = oa.rockspecVersion;
2727-2828- extraConfig = ''
2929- -- to create a flat hierarchy
3030- lua_modules_path = "lua"
3131- '';
3232- });
3131+ extraConfig = ''
3232+ -- to create a flat hierarchy
3333+ lua_modules_path = "lua"
3434+ '';
3535+ });
33363434- finalDrv = toVimPlugin (luaDrv.overrideAttrs(oa: attrs // {
3535- nativeBuildInputs = oa.nativeBuildInputs or [] ++ [
3636- lua.pkgs.luarocksMoveDataFolder
3737- ];
3838- version = "${originalLuaDrv.version}-unstable-${oa.version}";
3939- }));
4040- in
4141- finalDrv
3737+ finalDrv = toVimPlugin (
3838+ luaDrv.overrideAttrs (
3939+ oa:
4040+ attrs
4141+ // {
4242+ nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [
4343+ lua.pkgs.luarocksMoveDataFolder
4444+ ];
4545+ version = "${originalLuaDrv.version}-unstable-${oa.version}";
4646+ }
4747+ )
4848+ );
4949+in
5050+finalDrv
+4-4
pkgs/applications/editors/neovim/utils.nix
···171171 withPython3 ? true,
172172 withNodeJs ? false,
173173 withRuby ? true,
174174- # perl is problematic https://github.com/NixOS/nixpkgs/issues/132368
174174+ # Perl is problematic https://github.com/NixOS/nixpkgs/issues/132368
175175 withPerl ? false,
176176177177 # so that we can pass the full neovim config while ignoring it
···272272 ));
273273274274 /*
275275- Fork of vimUtils.packDir that additionnally generates a propagated-build-inputs-file that
275275+ Fork of vimUtils.packDir that additionally generates a propagated-build-inputs-file that
276276 can be used by the lua hooks to generate a proper LUA_PATH
277277278278 Generates a packpath folder as expected by vim
···286286 rawPackDir = vimUtils.packDir packages;
287287288288 in
289289- rawPackDir.override ({
289289+ rawPackDir.override {
290290 postBuild = ''
291291 mkdir $out/nix-support
292292 for i in $(find -L $out -name propagated-build-inputs ); do
293293 cat "$i" >> $out/nix-support/propagated-build-inputs
294294 done
295295 '';
296296- });
296296+ };
297297298298in
299299{
+326-254
pkgs/applications/editors/neovim/wrapper.nix
···11-{ stdenv, symlinkJoin, lib, makeWrapper
22-, bundlerEnv
33-, ruby
44-, nodejs
55-, writeText
66-, neovim-node-client
77-, python3
88-, callPackage
99-, neovimUtils
1010-, perl
1111-, lndir
1212-, vimUtils
11+{
22+ stdenv,
33+ lib,
44+ makeWrapper,
55+ bundlerEnv,
66+ ruby,
77+ nodejs,
88+ writeText,
99+ neovim-node-client,
1010+ python3,
1111+ callPackage,
1212+ neovimUtils,
1313+ perl,
1414+ lndir,
1515+ vimUtils,
1316}:
14171518neovim-unwrapped:
···1821 # inherit interpreter from neovim
1922 lua = neovim-unwrapped.lua;
20232121- wrapper = {
2222- extraName ? ""
2323- # certain plugins need a custom configuration (available in passthru.initLua)
2424- # to work with nix.
2525- # if true, the wrapper automatically appends those snippets when necessary
2626- , autoconfigure ? true
2424+ wrapper =
2525+ {
2626+ extraName ? "",
2727+ # certain plugins need a custom configuration (available in passthru.initLua)
2828+ # to work with nix.
2929+ # if true, the wrapper automatically appends those snippets when necessary
3030+ autoconfigure ? true,
27312828- # append to PATH runtime deps of plugins
2929- , autowrapRuntimeDeps ? true
3232+ # append to PATH runtime deps of plugins
3333+ autowrapRuntimeDeps ? true,
30343131- # should contain all args but the binary. Can be either a string or list
3232- , wrapperArgs ? []
3333- , withPython2 ? false
3434- , withPython3 ? true
3535- /* the function you would have passed to python3.withPackages */
3636- , extraPython3Packages ? (_: [ ])
3535+ # should contain all args but the binary. Can be either a string or list
3636+ wrapperArgs ? [ ],
3737+ withPython2 ? false,
3838+ withPython3 ? true,
3939+ # the function you would have passed to python3.withPackages
4040+ extraPython3Packages ? (_: [ ]),
37413838- , withNodeJs ? false
3939- , withPerl ? false
4040- , withRuby ? true
4242+ withNodeJs ? false,
4343+ withPerl ? false,
4444+ withRuby ? true,
41454242- # wether to create symlinks in $out/bin/vi(m) -> $out/bin/nvim
4343- , vimAlias ? false
4444- , viAlias ? false
4646+ # wether to create symlinks in $out/bin/vi(m) -> $out/bin/nvim
4747+ vimAlias ? false,
4848+ viAlias ? false,
45494646- # additional argument not generated by makeNeovimConfig
4747- # it will append "-u <customRc>" to the wrapped arguments
4848- # set to false if you want to control where to save the generated config
4949- # (e.g., in ~/.config/init.vim or project/.nvimrc)
5050- , wrapRc ? true
5151- # vimL code that should be sourced as part of the generated init.lua file
5252- , neovimRcContent ? null
5353- # lua code to put into the generated init.lua file
5454- , luaRcContent ? ""
5555- # DEPRECATED: entry to load in packpath
5656- # use 'plugins' instead
5757- , packpathDirs ? null # not used anymore
5050+ # additional argument not generated by makeNeovimConfig
5151+ # it will append "-u <customRc>" to the wrapped arguments
5252+ # set to false if you want to control where to save the generated config
5353+ # (e.g., in ~/.config/init.vim or project/.nvimrc)
5454+ wrapRc ? true,
5555+ # vimL code that should be sourced as part of the generated init.lua file
5656+ neovimRcContent ? null,
5757+ # lua code to put into the generated init.lua file
5858+ luaRcContent ? "",
5959+ # DEPRECATED: entry to load in packpath
6060+ # use 'plugins' instead
6161+ packpathDirs ? null, # not used anymore
58625959- # a list of neovim plugin derivations, for instance
6060- # plugins = [
6161- # { plugin=far-vim; config = "let g:far#source='rg'"; optional = false; }
6262- # ]
6363- , plugins ? []
6464- , ...
6565- }@attrs:
6666- assert withPython2 -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env.";
6363+ # a list of neovim plugin derivations, for instance
6464+ # plugins = [
6565+ # { plugin=far-vim; config = "let g:far#source='rg'"; optional = false; }
6666+ # ]
6767+ plugins ? [ ],
6868+ ...
6969+ }@attrs:
7070+ assert
7171+ withPython2
7272+ -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env.";
67736868- assert packpathDirs != null -> throw "packpathdirs is not used anymore: pass a list of neovim plugin derivations in 'plugins' instead.";
7474+ assert
7575+ packpathDirs != null
7676+ -> throw "packpathdirs is not used anymore: pass a list of neovim plugin derivations in 'plugins' instead.";
69777070- stdenv.mkDerivation (finalAttrs:
7171- let
7272- pluginsNormalized = neovimUtils.normalizePlugins finalAttrs.plugins;
7878+ stdenv.mkDerivation (
7979+ finalAttrs:
8080+ let
8181+ pluginsNormalized = neovimUtils.normalizePlugins finalAttrs.plugins;
73827474- myVimPackage = neovimUtils.normalizedPluginsToVimPackage pluginsNormalized;
8383+ myVimPackage = neovimUtils.normalizedPluginsToVimPackage pluginsNormalized;
75847676- rubyEnv = bundlerEnv {
7777- name = "neovim-ruby-env";
7878- gemdir = ./ruby_provider;
7979- postBuild = ''
8080- ln -sf ${ruby}/bin/* $out/bin
8181- '';
8282- };
8585+ rubyEnv = bundlerEnv {
8686+ name = "neovim-ruby-env";
8787+ gemdir = ./ruby_provider;
8888+ postBuild = ''
8989+ ln -sf ${ruby}/bin/* $out/bin
9090+ '';
9191+ };
83928484- pluginRC = lib.foldl (acc: p: if p.config != null then acc ++ [p.config] else acc) [] pluginsNormalized;
9393+ pluginRC = lib.foldl (
9494+ acc: p: if p.config != null then acc ++ [ p.config ] else acc
9595+ ) [ ] pluginsNormalized;
85968686- # a limited RC script used only to generate the manifest for remote plugins
8787- manifestRc = "";
8888- # we call vimrcContent without 'packages' to avoid the init.vim generation
8989- neovimRcContent' = lib.concatStringsSep "\n" (pluginRC ++ lib.optional (neovimRcContent != null) neovimRcContent);
9797+ # a limited RC script used only to generate the manifest for remote plugins
9898+ manifestRc = "";
9999+ # we call vimrcContent without 'packages' to avoid the init.vim generation
100100+ neovimRcContent' = lib.concatStringsSep "\n" (
101101+ pluginRC ++ lib.optional (neovimRcContent != null) neovimRcContent
102102+ );
901039191- packpathDirs.myNeovimPackages = myVimPackage;
9292- finalPackdir = neovimUtils.packDir packpathDirs;
104104+ packpathDirs.myNeovimPackages = myVimPackage;
105105+ finalPackdir = neovimUtils.packDir packpathDirs;
931069494- luaPluginRC = let
9595- op = acc: normalizedPlugin:
9696- acc ++ lib.optional (finalAttrs.autoconfigure && normalizedPlugin.plugin.passthru ? initLua) normalizedPlugin.plugin.passthru.initLua;
9797- in
9898- lib.foldl' op [] pluginsNormalized;
107107+ luaPluginRC =
108108+ let
109109+ op =
110110+ acc: normalizedPlugin:
111111+ acc
112112+ ++ lib.optional (
113113+ finalAttrs.autoconfigure && normalizedPlugin.plugin.passthru ? initLua
114114+ ) normalizedPlugin.plugin.passthru.initLua;
115115+ in
116116+ lib.foldl' op [ ] pluginsNormalized;
99117100100- rcContent = ''
101101- ${luaRcContent}
102102- '' + lib.optionalString (neovimRcContent' != null) ''
103103- vim.cmd.source "${writeText "init.vim" neovimRcContent'}"
104104- '' +
105105- lib.concatStringsSep "\n" luaPluginRC
106106- ;
118118+ rcContent =
119119+ ''
120120+ ${luaRcContent}
121121+ ''
122122+ + lib.optionalString (neovimRcContent' != null) ''
123123+ vim.cmd.source "${writeText "init.vim" neovimRcContent'}"
124124+ ''
125125+ + lib.concatStringsSep "\n" luaPluginRC;
107126108108- getDeps = attrname: map (plugin: plugin.${attrname} or (_: [ ]));
127127+ getDeps = attrname: map (plugin: plugin.${attrname} or (_: [ ]));
109128110110- requiredPlugins = vimUtils.requiredPluginsForPackage myVimPackage;
111111- pluginPython3Packages = getDeps "python3Dependencies" requiredPlugins;
129129+ requiredPlugins = vimUtils.requiredPluginsForPackage myVimPackage;
130130+ pluginPython3Packages = getDeps "python3Dependencies" requiredPlugins;
112131113113- python3Env = lib.warnIf (attrs ? python3Env) "Pass your python packages via the `extraPython3Packages`, e.g., `extraPython3Packages = ps: [ ps.pandas ]`"
114114- python3.pkgs.python.withPackages (ps:
115115- [ ps.pynvim ]
116116- ++ (extraPython3Packages ps)
117117- ++ (lib.concatMap (f: f ps) pluginPython3Packages));
132132+ python3Env =
133133+ lib.warnIf (attrs ? python3Env)
134134+ "Pass your python packages via the `extraPython3Packages`, e.g., `extraPython3Packages = ps: [ ps.pandas ]`"
135135+ python3.pkgs.python.withPackages
136136+ (ps: [ ps.pynvim ] ++ (extraPython3Packages ps) ++ (lib.concatMap (f: f ps) pluginPython3Packages));
118137138138+ wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
119139120120- wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
140140+ generatedWrapperArgs =
141141+ [
142142+ # vim accepts a limited number of commands so we join all the provider ones
143143+ "--add-flags"
144144+ ''--cmd "lua ${providerLuaRc}"''
145145+ ]
146146+ ++
147147+ lib.optionals
148148+ (
149149+ finalAttrs.packpathDirs.myNeovimPackages.start != [ ]
150150+ || finalAttrs.packpathDirs.myNeovimPackages.opt != [ ]
151151+ )
152152+ [
153153+ "--add-flags"
154154+ ''--cmd "set packpath^=${finalPackdir}"''
155155+ "--add-flags"
156156+ ''--cmd "set rtp^=${finalPackdir}"''
157157+ ]
158158+ ++ lib.optionals finalAttrs.withRuby [
159159+ "--set"
160160+ "GEM_HOME"
161161+ "${rubyEnv}/${rubyEnv.ruby.gemPath}"
162162+ ]
163163+ ++ lib.optionals (finalAttrs.runtimeDeps != [ ]) [
164164+ "--suffix"
165165+ "PATH"
166166+ ":"
167167+ (lib.makeBinPath finalAttrs.runtimeDeps)
168168+ ];
121169122122- generatedWrapperArgs =
123123- [
124124- # vim accepts a limited number of commands so we join all the provider ones
125125- "--add-flags" ''--cmd "lua ${providerLuaRc}"''
126126- ]
127127- ++ lib.optionals (finalAttrs.packpathDirs.myNeovimPackages.start != [] || finalAttrs.packpathDirs.myNeovimPackages.opt != []) [
128128- "--add-flags" ''--cmd "set packpath^=${finalPackdir}"''
129129- "--add-flags" ''--cmd "set rtp^=${finalPackdir}"''
130130- ]
131131- ++ lib.optionals finalAttrs.withRuby [
132132- "--set" "GEM_HOME" "${rubyEnv}/${rubyEnv.ruby.gemPath}"
133133- ] ++ lib.optionals (finalAttrs.runtimeDeps != []) [
134134- "--suffix" "PATH" ":" (lib.makeBinPath finalAttrs.runtimeDeps)
135135- ]
170170+ providerLuaRc = neovimUtils.generateProviderRc {
171171+ inherit (finalAttrs)
172172+ withPython3
173173+ withNodeJs
174174+ withPerl
175175+ withRuby
136176 ;
137137-138138- providerLuaRc = neovimUtils.generateProviderRc {
139139- inherit (finalAttrs) withPython3 withNodeJs withPerl withRuby;
140140- };
141141-142142- # If configure != {}, we can't generate the rplugin.vim file with e.g
143143- # NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
144144- # the wrapper. That's why only when configure != {} (tested both here and
145145- # when postBuild is evaluated), we call makeWrapper once to generate a
146146- # wrapper with most arguments we need, excluding those that cause problems to
147147- # generate rplugin.vim, but still required for the final wrapper.
148148- finalMakeWrapperArgs =
149149- [ "${neovim-unwrapped}/bin/nvim" "${placeholder "out"}/bin/nvim" ]
150150- ++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]
151151- ++ lib.optionals finalAttrs.wrapRc [ "--add-flags" "-u ${writeText "init.lua" rcContent}" ]
152152- ++ finalAttrs.generatedWrapperArgs
153153- ;
154154-155155- perlEnv = perl.withPackages (p: [ p.NeovimExt p.Appcpanminus ]);
156156-157157- pname = "neovim";
158158- version = lib.getVersion neovim-unwrapped;
159159- in {
160160- name = "${pname}-${version}${extraName}";
161161- inherit pname version;
162162- inherit plugins;
177177+ };
163178164164- __structuredAttrs = true;
165165- dontUnpack = true;
166166- inherit viAlias vimAlias withNodeJs withPython3 withPerl withRuby;
167167- inherit autoconfigure autowrapRuntimeDeps wrapRc providerLuaRc packpathDirs;
168168- inherit python3Env rubyEnv;
169169- inherit wrapperArgs generatedWrapperArgs;
179179+ # If `configure` != {}, we can't generate the rplugin.vim file with e.g
180180+ # NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
181181+ # the wrapper. That's why only when `configure` != {} (tested both here and
182182+ # when `postBuild` is evaluated), we call makeWrapper once to generate a
183183+ # wrapper with most arguments we need, excluding those that cause problems to
184184+ # generate rplugin.vim, but still required for the final wrapper.
185185+ finalMakeWrapperArgs =
186186+ [
187187+ "${neovim-unwrapped}/bin/nvim"
188188+ "${placeholder "out"}/bin/nvim"
189189+ ]
190190+ ++ [
191191+ "--set"
192192+ "NVIM_SYSTEM_RPLUGIN_MANIFEST"
193193+ "${placeholder "out"}/rplugin.vim"
194194+ ]
195195+ ++ lib.optionals finalAttrs.wrapRc [
196196+ "--add-flags"
197197+ "-u ${writeText "init.lua" rcContent}"
198198+ ]
199199+ ++ finalAttrs.generatedWrapperArgs;
170200201201+ perlEnv = perl.withPackages (p: [
202202+ p.NeovimExt
203203+ p.Appcpanminus
204204+ ]);
171205172172- runtimeDeps = let
173173- op = acc: normalizedPlugin: acc ++ normalizedPlugin.plugin.runtimeDeps or [];
174174- runtimeDeps = lib.foldl' op [] pluginsNormalized;
206206+ pname = "neovim";
207207+ version = lib.getVersion neovim-unwrapped;
175208 in
176176- lib.optional finalAttrs.withRuby rubyEnv
177177- ++ lib.optional finalAttrs.withNodeJs nodejs
178178- ++ lib.optionals finalAttrs.autowrapRuntimeDeps runtimeDeps
209209+ {
210210+ name = "${pname}-${version}${extraName}";
211211+ inherit pname version;
212212+ inherit plugins;
213213+214214+ __structuredAttrs = true;
215215+ dontUnpack = true;
216216+ inherit
217217+ viAlias
218218+ vimAlias
219219+ withNodeJs
220220+ withPython3
221221+ withPerl
222222+ withRuby
179223 ;
224224+ inherit
225225+ autoconfigure
226226+ autowrapRuntimeDeps
227227+ wrapRc
228228+ providerLuaRc
229229+ packpathDirs
230230+ ;
231231+ inherit python3Env rubyEnv;
232232+ inherit wrapperArgs generatedWrapperArgs;
180233234234+ runtimeDeps =
235235+ let
236236+ op = acc: normalizedPlugin: acc ++ normalizedPlugin.plugin.runtimeDeps or [ ];
237237+ runtimeDeps = lib.foldl' op [ ] pluginsNormalized;
238238+ in
239239+ lib.optional finalAttrs.withRuby rubyEnv
240240+ ++ lib.optional finalAttrs.withNodeJs nodejs
241241+ ++ lib.optionals finalAttrs.autowrapRuntimeDeps runtimeDeps;
181242182182- luaRcContent = rcContent;
183183- # Remove the symlinks created by symlinkJoin which we need to perform
184184- # extra actions upon
185185- postBuild = lib.optionalString stdenv.hostPlatform.isLinux ''
186186- rm $out/share/applications/nvim.desktop
187187- substitute ${neovim-unwrapped}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
188188- --replace-warn 'Name=Neovim' 'Name=Neovim wrapper'
189189- ''
190190- + lib.optionalString finalAttrs.withPython3 ''
191191- makeWrapper ${python3Env.interpreter} $out/bin/nvim-python3 --unset PYTHONPATH --unset PYTHONSAFEPATH
192192- ''
193193- + lib.optionalString (finalAttrs.withRuby) ''
194194- ln -s ${finalAttrs.rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby
195195- ''
196196- + lib.optionalString finalAttrs.withNodeJs ''
197197- ln -s ${neovim-node-client}/bin/neovim-node-host $out/bin/nvim-node
198198- ''
199199- + lib.optionalString finalAttrs.withPerl ''
200200- ln -s ${perlEnv}/bin/perl $out/bin/nvim-perl
201201- ''
202202- + lib.optionalString finalAttrs.vimAlias ''
203203- ln -s $out/bin/nvim $out/bin/vim
204204- ''
205205- + lib.optionalString finalAttrs.viAlias ''
206206- ln -s $out/bin/nvim $out/bin/vi
207207- ''
208208- + lib.optionalString (manifestRc != null) (let
209209- manifestWrapperArgs =
210210- [ "${neovim-unwrapped}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ] ++ finalAttrs.generatedWrapperArgs;
211211- in ''
212212- echo "Generating remote plugin manifest"
213213- export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim
214214- makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgsStr}
243243+ luaRcContent = rcContent;
244244+ # Remove the symlinks created by symlinkJoin which we need to perform
245245+ # extra actions upon
246246+ postBuild =
247247+ lib.optionalString stdenv.hostPlatform.isLinux ''
248248+ rm $out/share/applications/nvim.desktop
249249+ substitute ${neovim-unwrapped}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
250250+ --replace-warn 'Name=Neovim' 'Name=Neovim wrapper'
251251+ ''
252252+ + lib.optionalString finalAttrs.withPython3 ''
253253+ makeWrapper ${python3Env.interpreter} $out/bin/nvim-python3 --unset PYTHONPATH --unset PYTHONSAFEPATH
254254+ ''
255255+ + lib.optionalString (finalAttrs.withRuby) ''
256256+ ln -s ${finalAttrs.rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby
257257+ ''
258258+ + lib.optionalString finalAttrs.withNodeJs ''
259259+ ln -s ${neovim-node-client}/bin/neovim-node-host $out/bin/nvim-node
260260+ ''
261261+ + lib.optionalString finalAttrs.withPerl ''
262262+ ln -s ${perlEnv}/bin/perl $out/bin/nvim-perl
263263+ ''
264264+ + lib.optionalString finalAttrs.vimAlias ''
265265+ ln -s $out/bin/nvim $out/bin/vim
266266+ ''
267267+ + lib.optionalString finalAttrs.viAlias ''
268268+ ln -s $out/bin/nvim $out/bin/vi
269269+ ''
270270+ + lib.optionalString (manifestRc != null) (
271271+ let
272272+ manifestWrapperArgs = [
273273+ "${neovim-unwrapped}/bin/nvim"
274274+ "${placeholder "out"}/bin/nvim-wrapper"
275275+ ] ++ finalAttrs.generatedWrapperArgs;
276276+ in
277277+ ''
278278+ echo "Generating remote plugin manifest"
279279+ export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim
280280+ makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgsStr}
215281216216- # Some plugins assume that the home directory is accessible for
217217- # initializing caches, temporary files, etc. Even if the plugin isn't
218218- # actively used, it may throw an error as soon as Neovim is launched
219219- # (e.g., inside an autoload script), causing manifest generation to
220220- # fail. Therefore, let's create a fake home directory before generating
221221- # the manifest, just to satisfy the needs of these plugins.
222222- #
223223- # See https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L10
224224- # for an example of this behavior.
225225- export HOME="$(mktemp -d)"
226226- # Launch neovim with a vimrc file containing only the generated plugin
227227- # code. Pass various flags to disable temp file generation
228228- # (swap/viminfo) and redirect errors to stderr.
229229- # Only display the log on error since it will contain a few normally
230230- # irrelevant messages.
231231- if ! $out/bin/nvim-wrapper \
232232- -u ${writeText "manifest.vim" manifestRc} \
233233- -i NONE -n \
234234- -V1rplugins.log \
235235- +UpdateRemotePlugins +quit! > outfile 2>&1; then
236236- cat outfile
237237- echo -e "\nGenerating rplugin.vim failed!"
238238- exit 1
239239- fi
240240- rm "${placeholder "out"}/bin/nvim-wrapper"
241241- '')
242242- + ''
243243- rm $out/bin/nvim
244244- touch $out/rplugin.vim
282282+ # Some plugins assume that the home directory is accessible for
283283+ # initializing caches, temporary files, etc. Even if the plugin isn't
284284+ # actively used, it may throw an error as soon as Neovim is launched
285285+ # (e.g., inside an autoload script), causing manifest generation to
286286+ # fail. Therefore, let's create a fake home directory before generating
287287+ # the manifest, just to satisfy the needs of these plugins.
288288+ #
289289+ # See https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L10
290290+ # for an example of this behavior.
291291+ export HOME="$(mktemp -d)"
292292+ # Launch neovim with a vimrc file containing only the generated plugin
293293+ # code. Pass various flags to disable temp file generation
294294+ # (swap/viminfo) and redirect errors to stderr.
295295+ # Only display the log on error since it will contain a few normally
296296+ # irrelevant messages.
297297+ if ! $out/bin/nvim-wrapper \
298298+ -u ${writeText "manifest.vim" manifestRc} \
299299+ -i NONE -n \
300300+ -V1rplugins.log \
301301+ +UpdateRemotePlugins +quit! > outfile 2>&1; then
302302+ cat outfile
303303+ echo -e "\nGenerating rplugin.vim failed!"
304304+ exit 1
305305+ fi
306306+ rm "${placeholder "out"}/bin/nvim-wrapper"
307307+ ''
308308+ )
309309+ + ''
310310+ rm $out/bin/nvim
311311+ touch $out/rplugin.vim
245312246246- echo "Looking for lua dependencies..."
247247- source ${lua}/nix-support/utils.sh
313313+ echo "Looking for lua dependencies..."
314314+ source ${lua}/nix-support/utils.sh
248315249249- _addToLuaPath "${finalPackdir}"
316316+ _addToLuaPath "${finalPackdir}"
250317251251- echo "LUA_PATH towards the end of packdir: $LUA_PATH"
318318+ echo "LUA_PATH towards the end of packdir: $LUA_PATH"
252319253253- makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgsStr} \
254254- --prefix LUA_PATH ';' "$LUA_PATH" \
255255- --prefix LUA_CPATH ';' "$LUA_CPATH"
256256- '';
320320+ makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgsStr} \
321321+ --prefix LUA_PATH ';' "$LUA_PATH" \
322322+ --prefix LUA_CPATH ';' "$LUA_CPATH"
323323+ '';
257324258258- buildPhase = ''
259259- runHook preBuild
260260- mkdir -p $out
261261- for i in ${neovim-unwrapped}; do
262262- lndir -silent $i $out
263263- done
264264- runHook postBuild
265265- '';
325325+ buildPhase = ''
326326+ runHook preBuild
327327+ mkdir -p $out
328328+ for i in ${neovim-unwrapped}; do
329329+ lndir -silent $i $out
330330+ done
331331+ runHook postBuild
332332+ '';
266333267267- preferLocalBuild = true;
334334+ preferLocalBuild = true;
268335269269- nativeBuildInputs = [ makeWrapper lndir ];
336336+ nativeBuildInputs = [
337337+ makeWrapper
338338+ lndir
339339+ ];
270340271271- # A Vim "package", see ':h packages'
272272- vimPackage = myVimPackage;
341341+ # A Vim "package", see ':h packages'
342342+ vimPackage = myVimPackage;
273343274274- checkPhase = ''
275275- runHook preCheck
344344+ checkPhase = ''
345345+ runHook preCheck
276346277277- $out/bin/nvim -i NONE -e +quitall!
278278- runHook postCheck
279279- '';
347347+ $out/bin/nvim -i NONE -e +quitall!
348348+ runHook postCheck
349349+ '';
280350281281- passthru = {
282282- inherit providerLuaRc packpathDirs;
283283- unwrapped = neovim-unwrapped;
284284- initRc = neovimRcContent';
351351+ passthru = {
352352+ inherit providerLuaRc packpathDirs;
353353+ unwrapped = neovim-unwrapped;
354354+ initRc = neovimRcContent';
285355286286- tests = callPackage ./tests {
287287- };
288288- };
356356+ tests = callPackage ./tests {
357357+ };
358358+ };
289359290290- meta = {
291291- inherit (neovim-unwrapped.meta)
292292- description
293293- longDescription
294294- homepage
295295- mainProgram
296296- license
297297- maintainers
298298- platforms;
360360+ meta = {
361361+ inherit (neovim-unwrapped.meta)
362362+ description
363363+ longDescription
364364+ homepage
365365+ mainProgram
366366+ license
367367+ maintainers
368368+ platforms
369369+ ;
299370300300- # To prevent builds on hydra
301301- hydraPlatforms = [];
302302- # prefer wrapper over the package
303303- priority = (neovim-unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
304304- };
305305- });
371371+ # To prevent builds on hydra
372372+ hydraPlatforms = [ ];
373373+ # prefer wrapper over the package
374374+ priority = (neovim-unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
375375+ };
376376+ }
377377+ );
306378in
307307- lib.makeOverridable wrapper
379379+lib.makeOverridable wrapper
···2121 applyPatches,
2222}:
2323let
2424- version = "4.0.12.2823";
2424+ version = "4.0.13.2932";
2525 # The dotnet8 compatibility patches also change `yarn.lock`, so we must pass
2626 # the already patched lockfile to `fetchYarnDeps`.
2727 src = applyPatches {
···2929 owner = "Sonarr";
3030 repo = "Sonarr";
3131 tag = "v${version}";
3232- hash = "sha256-gAvbA3Idx73QEDthLwrM8Jbt6YhXxK8LzEJI6eF2k20=";
3232+ hash = "sha256-BR7CU8q+L2CY2UqR9n0cbX9R7ergzRPPvSrLl7Cn7EU=";
3333 };
3434 patches =
3535 [
+2-1
pkgs/by-name/so/sonarr/update.py
···116116 old_source_hash: new_source_hash,
117117 })
118118119119- # We need access to the patched and updated src to get the patched `yarn.lock`.
119119+ # We need access to the patched and updated src to get the patched
120120+ # `yarn.lock`.
120121 patched_src = os.path.join(work_dir, "patched-src")
121122 subprocess.run(
122123 [