vimUtils: buildVimPluginFrom2Nix renamed to buildVimPlugin

the `from2Nix` suffix is a legacy from vim2nix but we dont use that anymore. It makes the name of the function unusual and long.
This commit is contained in:
Matthieu Coudron 2023-09-26 20:31:31 +02:00
parent c22ca8e820
commit 0ab2c96429
12 changed files with 1377 additions and 1378 deletions

View file

@ -134,7 +134,7 @@ If one of your favourite plugins isn't packaged, you can package it yourself:
{ config, pkgs, ... }:
let
easygrep = pkgs.vimUtils.buildVimPluginFrom2Nix {
easygrep = pkgs.vimUtils.buildVimPlugin {
name = "vim-easygrep";
src = pkgs.fetchFromGitHub {
owner = "dkprice";

View file

@ -119,6 +119,9 @@
- The `services.ananicy.extraRules` option now has the type of `listOf attrs` instead of `string`.
- `buildVimPluginFrom2Nix` has been renamed to `buildVimPlugin`, which now
now skips `configurePhase` and `buildPhase`
- JACK tools (`jack_*` except `jack_control`) have moved from the `jack2` package to `jack-example-tools`
- The `matrix-synapse` package & module have undergone some significant internal changes, for most setups no intervention is needed, though:

View file

@ -16,8 +16,8 @@ rec {
, namePrefix ? "vimplugin-"
, src
, unpackPhase ? ""
, configurePhase ? ""
, buildPhase ? ""
, configurePhase ? ":"
, buildPhase ? ":"
, preInstall ? ""
, postInstall ? ""
, path ? "."
@ -48,9 +48,4 @@ rec {
in
addRtp (toVimPlugin drv);
buildVimPluginFrom2Nix = attrs: buildVimPlugin ({
# vim plugins may override this
buildPhase = ":";
configurePhase = ":";
} // attrs);
}

View file

@ -7,14 +7,14 @@
let
inherit (vimUtils.override {inherit vim;})
buildVimPluginFrom2Nix;
buildVimPlugin;
inherit (lib) extends;
initialPackages = self: { };
plugins = callPackage ./generated.nix {
inherit buildVimPluginFrom2Nix;
inherit buildVimPlugin;
inherit (neovimUtils) buildNeovimPlugin;
};
@ -26,7 +26,7 @@ let
# add to ./overrides.nix.
overrides = callPackage ./overrides.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa CoreFoundation CoreServices;
inherit buildVimPluginFrom2Nix;
inherit buildVimPlugin;
inherit llvmPackages luaPackages;
};

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
with import <localpkgs> {};
let
inherit (vimUtils.override {inherit vim;}) buildVimPluginFrom2Nix;
inherit (vimUtils.override {inherit vim;}) buildVimPlugin;
inherit (neovimUtils) buildNeovimPlugin;
generated = callPackage <localpkgs/pkgs/applications/editors/vim/plugins/generated.nix> {
inherit buildNeovimPlugin buildVimPluginFrom2Nix;
inherit buildNeovimPlugin buildVimPlugin;
} {} {};
hasChecksum = value:
lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value;

View file

@ -3,7 +3,7 @@
# nixpkgs functions
, buildGoModule
, buildVimPluginFrom2Nix
, buildVimPlugin
, fetchFromGitHub
, fetchFromSourcehut
, fetchpatch
@ -153,7 +153,7 @@ self: super: {
};
# The GitHub repository returns 404, which breaks the update script
bitbake-vim = buildVimPluginFrom2Nix {
bitbake-vim = buildVimPlugin {
pname = "bitbake.vim";
version = "2021-02-06";
src = fetchFromGitHub {
@ -305,7 +305,7 @@ self: super: {
dependencies = with self; [ nvim-cmp zsh ];
};
coc-nginx = buildVimPluginFrom2Nix {
coc-nginx = buildVimPlugin {
pname = "coc-nginx";
inherit (nodePackages."@yaegassy/coc-nginx") version meta;
src = "${nodePackages."@yaegassy/coc-nginx"}/lib/node_modules/@yaegassy/coc-nginx";
@ -553,7 +553,7 @@ self: super: {
# Mainly used as a dependency for fzf-vim. Wraps the fzf program as a vim
# plugin, since part of the fzf vim plugin is included in the main fzf
# program.
fzfWrapper = buildVimPluginFrom2Nix {
fzfWrapper = buildVimPlugin {
inherit (fzf) src version;
pname = "fzf";
postInstall = ''
@ -594,7 +594,7 @@ self: super: {
};
# https://hurl.dev/
hurl = buildVimPluginFrom2Nix {
hurl = buildVimPlugin {
pname = "hurl";
version = hurl.version;
# dontUnpack = true;
@ -658,7 +658,7 @@ self: super: {
'';
};
in
buildVimPluginFrom2Nix {
buildVimPlugin {
pname = "LanguageClient-neovim";
inherit version;
src = LanguageClient-neovim-src;
@ -707,7 +707,7 @@ self: super: {
dependencies = with self; [ plenary-nvim ];
};
magma-nvim-goose = buildVimPluginFrom2Nix {
magma-nvim-goose = buildVimPlugin {
pname = "magma-nvim-goose";
version = "2023-03-13";
src = fetchFromGitHub {
@ -767,7 +767,7 @@ self: super: {
dependencies = with self; [ mason-nvim ];
};
meson = buildVimPluginFrom2Nix {
meson = buildVimPlugin {
inherit (meson) pname version src;
preInstall = "cd data/syntax-highlighting/vim";
meta.maintainers = with lib.maintainers; [ vcunat ];
@ -785,7 +785,7 @@ self: super: {
vimCommandCheck = "MinimapToggle";
};
minsnip-nvim = buildVimPluginFrom2Nix {
minsnip-nvim = buildVimPlugin {
pname = "minsnip.nvim";
version = "2022-01-04";
src = fetchFromGitHub {
@ -939,7 +939,7 @@ self: super: {
inherit parinfer-rust;
phpactor = buildVimPluginFrom2Nix {
phpactor = buildVimPlugin {
inherit (phpactor) pname src meta version;
postPatch = ''
substituteInPlace plugin/phpactor.vim \
@ -1008,7 +1008,7 @@ self: super: {
'';
});
skim = buildVimPluginFrom2Nix {
skim = buildVimPlugin {
pname = "skim";
inherit (skim) version;
src = skim.vim;
@ -1048,7 +1048,7 @@ self: super: {
doCheck = false;
};
in
buildVimPluginFrom2Nix {
buildVimPlugin {
pname = "sniprun";
inherit version src;
@ -1061,7 +1061,7 @@ self: super: {
};
# The GitHub repository returns 404, which breaks the update script
Spacegray-vim = buildVimPluginFrom2Nix {
Spacegray-vim = buildVimPlugin {
pname = "Spacegray.vim";
version = "2021-07-06";
src = fetchFromGitHub {
@ -1086,7 +1086,7 @@ self: super: {
dependencies = with self; [ nvim-treesitter ];
};
statix = buildVimPluginFrom2Nix rec {
statix = buildVimPlugin rec {
inherit (statix) pname src meta;
version = "0.1.0";
postPatch = ''
@ -1136,7 +1136,7 @@ self: super: {
};
};
taskwarrior = buildVimPluginFrom2Nix {
taskwarrior = buildVimPlugin {
inherit (taskwarrior) version pname;
src = "${taskwarrior.src}/scripts/vim";
};
@ -1222,7 +1222,7 @@ self: super: {
au BufNewFile,BufRead Tupfile,*.tup setf tup
'';
in
buildVimPluginFrom2Nix {
buildVimPlugin {
inherit (tup) pname version src;
preInstall = ''
mkdir -p vim-plugin/syntax vim-plugin/ftdetect
@ -1546,7 +1546,7 @@ self: super: {
'';
};
vim2nix = buildVimPluginFrom2Nix {
vim2nix = buildVimPlugin {
pname = "vim2nix";
version = "1.0";
src = ./vim2nix;
@ -1570,7 +1570,7 @@ self: super: {
};
# The GitHub repository returns 404, which breaks the update script
VimCompletesMe = buildVimPluginFrom2Nix {
VimCompletesMe = buildVimPlugin {
pname = "VimCompletesMe";
version = "2022-02-18";
src = fetchFromGitHub {
@ -1706,7 +1706,7 @@ self: super: {
"coc-yaml"
"coc-yank"
];
nodePackage2VimPackage = name: buildVimPluginFrom2Nix {
nodePackage2VimPackage = name: buildVimPlugin {
pname = name;
inherit (nodePackages.${name}) version meta;
src = "${nodePackages.${name}}/lib/node_modules/${name}";

View file

@ -74,7 +74,7 @@ class VimEditor(pluginupdate.Editor):
with open(outfile, "w+") as f:
f.write(HEADER)
f.write(textwrap.dedent("""
{ lib, buildVimPluginFrom2Nix, buildNeovimPlugin, fetchFromGitHub, fetchgit }:
{ lib, buildVimPlugin, buildNeovimPlugin, fetchFromGitHub, fetchgit }:
final: prev:
{
@ -103,7 +103,7 @@ class VimEditor(pluginupdate.Editor):
}};
""".format(
buildFn="buildNeovimPlugin" if isNeovim else "buildVimPluginFrom2Nix", plugin=plugin, src_nix=src_nix, repo=repo)
buildFn="buildNeovimPlugin" if isNeovim else "buildVimPlugin", plugin=plugin, src_nix=src_nix, repo=repo)
log.debug(content)
return content

View file

@ -53,7 +53,7 @@ let
};
in
vimUtils.buildVimPluginFrom2Nix {
vimUtils.buildVimPlugin {
pname = "vim-clap";
inherit version src meta;

View file

@ -392,8 +392,9 @@ rec {
inherit (import ./build-vim-plugin.nix {
inherit lib stdenv rtpPath toVimPlugin;
}) buildVimPlugin buildVimPluginFrom2Nix;
}) buildVimPlugin;
buildVimPluginFrom2Nix = lib.warn "buildVimPluginFrom2Nix is deprecated: use buildVimPlugin instead" buildVimPlugin;
# used to figure out which python dependencies etc. neovim needs
requiredPlugins = {

View file

@ -50,7 +50,7 @@ fun! nix#NixDerivation(opts, name, repository) abort
let dependencies = nix#DependenciesFromCheckout(a:opts, a:name, a:repository, dir)
return {'n_a_name': n_a_name, 'n_n_name': n_n_name, 'dependencies': dependencies, 'derivation': join([
\ ' '.n_a_name.' = buildVimPluginFrom2Nix {'.created_notice,
\ ' '.n_a_name.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'-'.date.'";',
\ ' src = fetchgit {',
\ ' url = "'. a:repository.url .'";',
@ -74,7 +74,7 @@ fun! nix#NixDerivation(opts, name, repository) abort
let dependencies = nix#DependenciesFromCheckout(a:opts, a:name, a:repository, dir)
return {'n_a_name': n_a_name, 'n_n_name': n_n_name, 'dependencies': dependencies, 'derivation': join([
\ ' '.n_a_name.' = buildVimPluginFrom2Nix {'.created_notice,
\ ' '.n_a_name.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'";',
\ ' src = fetchhg {',
\ ' url = "'. a:repository.url .'";',
@ -99,7 +99,7 @@ fun! nix#NixDerivation(opts, name, repository) abort
let dependencies = keys(get(addon_info, 'dependencies', {}))
return {'n_a_name': n_a_name, 'n_n_name': n_n_name, 'dependencies': dependencies, 'derivation': join([
\ ' '.n_a_name.' = buildVimPluginFrom2Nix {'.created_notice,
\ ' '.n_a_name.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'";',
\ ' src = fetchurl {',
\ ' url = "'. a:repository.url .'";',

View file

@ -3,7 +3,7 @@
, pkgs
}:
let
inherit (vimUtils) buildVimPluginFrom2Nix;
inherit (vimUtils) buildVimPlugin;
packages.myVimPackage.start = with vimPlugins; [ vim-nix ];