push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,166 @@
# Deprecated aliases - for backward compatibility
lib:
final: prev:
let
# Removing recurseForDerivation prevents derivations of aliased attribute
# set to appear while listing all the packages available.
removeRecurseForDerivations =
alias:
if alias.recurseForDerivations or false then
lib.removeAttrs alias [ "recurseForDerivations" ]
else
alias;
# Disabling distribution prevents top-level aliases for non-recursed package
# sets from building on Hydra.
removeDistribute = alias: if lib.isDerivation alias then lib.dontDistribute alias else alias;
# Make sure that we are not shadowing something from
# all-packages.nix.
checkInPkgs =
n: alias: if builtins.hasAttr n prev then throw "Alias ${n} is still in vim-plugins" else alias;
mapAliases =
aliases:
lib.mapAttrs (
n: alias: removeDistribute (removeRecurseForDerivations (checkInPkgs n alias))
) aliases;
deprecations = lib.mapAttrs (
old: info: throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
) (lib.importJSON ./deprecated.json);
in
mapAliases (
with prev;
{
airline = vim-airline;
alternative = a-vim; # backwards compat, added 2014-10-21
bats = bats-vim;
blueballs-neovim = throw "`blueballs-neovim` has been removed"; # added 2025-06-17
BufOnly = BufOnly-vim;
calendar = calendar-vim;
coc-rls = throw "coc-rls has been removed, as rls has been archived since 2022. You should use coc-rust-analyzer instead, as rust-analyzer is maintained."; # addedd 2025-10-01
coc-vetur = throw "coc-vetur was removed, as vetur is unmaintained by Vue. You should switch to Volar, which supports Vue 3"; # added 2025-10-01
coffee-script = vim-coffee-script;
coffeeScript = vim-coffee-script; # backwards compat, added 2014-10-18
Solarized = vim-colors-solarized;
solarized = vim-colors-solarized;
spacevim = throw "this distribution was unmaintained for the last 6 years, please use top-level 'spacevim'"; # added 2024-11-27
SpaceVim = throw "this distribution didn't work properly in vimPlugins, please use top-level 'spacevim' instead"; # added 2024-11-27
sparkup = throw "the upstream repository got deleted"; # added 2025-08-06
colors-solarized = vim-colors-solarized;
caw = caw-vim;
chad = chadtree;
colorsamplerpack = Colour-Sampler-Pack;
Colour_Sampler_Pack = Colour-Sampler-Pack;
command_T = command-t; # backwards compat, added 2014-10-18
commentary = vim-commentary;
committia = committia-vim;
concealedyank = concealedyank-vim;
context-filetype = context_filetype-vim;
Cosco = cosco-vim;
css_color_5056 = vim-css-color;
CSApprox = csapprox;
csv = csv-vim;
ctrlp = ctrlp-vim;
cute-python = vim-cute-python;
denite = denite-nvim;
easy-align = vim-easy-align;
easygit = vim-easygit;
easymotion = vim-easymotion;
echodoc = echodoc-vim;
eighties = vim-eighties;
extradite = vim-extradite;
feline-nvim = throw "feline.nvim has been removed: upstream deleted repository. Consider using lualine"; # Added 2025-02-09
fugitive = vim-fugitive;
floating-nvim = throw "floating.nvim has been removed: abandoned by upstream. Use popup-nvim or nui-nvim"; # Added 2024-11-26
fzfWrapper = fzf-wrapper;
ghc-mod-vim = ghcmod-vim;
ghcmod = ghcmod-vim;
gleam-vim = throw "gleam.vim has been removed: its code was merged into vim."; # Added 2025-06-10
goyo = goyo-vim;
Gist = vim-gist;
gitgutter = vim-gitgutter;
gundo = gundo-vim;
Gundo = gundo-vim; # backwards compat, added 2015-10-03
haskellConceal = vim-haskellconceal; # backwards compat, added 2014-10-18
haskellConcealPlus = vim-haskellConcealPlus;
haskellconceal = vim-haskellconceal;
hier = vim-hier;
hlint-refactor = hlint-refactor-vim;
hoogle = vim-hoogle;
Hoogle = vim-hoogle;
indent-blankline-nvim-lua = indent-blankline-nvim; # backwards compat, added 2021-07-05
ipython = vim-ipython;
latex-live-preview = vim-latex-live-preview;
maktaba = vim-maktaba;
minsnip-nvim = throw "the upstream repository got deleted"; # added 2025-08-30
multiple-cursors = vim-multiple-cursors;
necoGhc = neco-ghc; # backwards compat, added 2014-10-18
neocomplete = neocomplete-vim;
neoinclude = neoinclude-vim;
neomru = neomru-vim;
neosnippet = neosnippet-vim;
neuron-nvim = throw "neuron.nvim has been removed: archived repository 2023-02-19"; # Added 2025-09-10
nvim-ts-rainbow = throw "nvim-ts-rainbow has been deprecated: Use rainbow-delimiters-nvim"; # Added 2023-11-30
nvim-ts-rainbow2 = throw "nvim-ts-rainbow2 has been deprecated: Use rainbow-delimiters-nvim"; # Added 2023-11-30
The_NERD_Commenter = nerdcommenter;
The_NERD_tree = nerdtree;
open-browser = open-browser-vim;
pathogen = vim-pathogen;
peskcolor-vim = throw "peskcolor-vim has been removed: abandoned by upstream"; # Added 2024-08-23
polyglot = vim-polyglot;
prettyprint = vim-prettyprint;
quickrun = vim-quickrun;
rainbow_parentheses = rainbow_parentheses-vim;
repeat = vim-repeat;
riv = riv-vim;
rhubarb = vim-rhubarb;
sensible = vim-sensible;
signature = vim-signature;
snipmate = vim-snipmate;
sourcemap = sourcemap-vim;
"sourcemap.vim" = sourcemap-vim;
Spacegray-vim = throw "Spacegray-vim has been removed: abandoned by upstream"; # Added 2025-03-24
surround = vim-surround;
sleuth = vim-sleuth;
solidity = vim-solidity;
ssr = ssr-nvim; # Added 2025-08-31
stylish-haskell = vim-stylish-haskell;
stylishHaskell = vim-stylish-haskell; # backwards compat, added 2014-10-18
suda-vim = vim-suda; # backwards compat, added 2024-05-16
Supertab = supertab;
Syntastic = syntastic;
SyntaxRange = vim-SyntaxRange;
table-mode = vim-table-mode;
taglist = taglist-vim;
tabpagebuffer = tabpagebuffer-vim;
tabpagecd = vim-tabpagecd;
Tabular = tabular;
Tagbar = tagbar;
thumbnail = thumbnail-vim;
tlib = tlib_vim;
tmux-navigator = vim-tmux-navigator;
tmuxNavigator = vim-tmux-navigator; # backwards compat, added 2014-10-18
todo-nvim = throw "todo-nvim has been removed: abandoned by upstream"; # Added 2023-08-23
tslime = tslime-vim;
unite = unite-vim;
UltiSnips = ultisnips;
vim-addon-vim2nix = vim2nix;
vim-sourcetrail = throw "vim-sourcetrail has been removed: abandoned by upstream"; # Added 2022-08-14
vimproc = vimproc-vim;
vimshell = vimshell-vim;
vinegar = vim-vinegar;
watchdogs = vim-watchdogs;
WebAPI = webapi-vim;
wombat256 = wombat256-vim; # backwards compat, added 2015-7-8
yankring = YankRing-vim;
Yankring = YankRing-vim;
xterm-color-table = xterm-color-table-vim;
zeavim = zeavim-vim;
}
// deprecations
)

View File

@@ -0,0 +1,74 @@
{
buildVimPlugin,
coc-basedpyright,
coc-clangd,
coc-css,
coc-diagnostic,
coc-docker,
coc-explorer,
coc-git,
coc-pyright,
coc-sh,
coc-spell-checker,
coc-toml,
}:
final: prev: {
coc-basedpyright = buildVimPlugin {
inherit (coc-basedpyright) pname version meta;
src = "${coc-basedpyright}/lib/node_modules/coc-basedpyright";
};
coc-clangd = buildVimPlugin {
inherit (coc-clangd) pname version meta;
src = "${coc-clangd}/lib/node_modules/coc-clangd";
};
coc-css = buildVimPlugin {
inherit (coc-css) pname version meta;
src = "${coc-css}/lib/node_modules/coc-css";
};
coc-diagnostic = buildVimPlugin {
inherit (coc-diagnostic) pname version meta;
src = "${coc-diagnostic}/lib/node_modules/coc-diagnostic";
};
coc-docker = buildVimPlugin {
inherit (coc-docker) pname version meta;
src = "${coc-docker}/lib/node_modules/coc-docker";
};
coc-explorer = buildVimPlugin {
inherit (coc-explorer) pname version meta;
src = "${coc-explorer}/lib/node_modules/coc-explorer";
};
coc-git = buildVimPlugin {
inherit (coc-git) pname version meta;
src = "${coc-git}/lib/node_modules/coc-git";
};
coc-pyright = buildVimPlugin {
pname = "coc-pyright";
inherit (coc-pyright) version meta;
src = "${coc-pyright}/lib/node_modules/coc-pyright";
};
coc-sh = buildVimPlugin {
pname = "coc-sh";
inherit (coc-sh) version meta;
src = "${coc-sh}/lib/node_modules/coc-sh";
};
coc-spell-checker = buildVimPlugin {
pname = "coc-spell-checker";
inherit (coc-spell-checker) version meta;
src = "${coc-spell-checker}/lib/node_modules/coc-spell-checker";
};
coc-toml = buildVimPlugin {
pname = "coc-toml";
inherit (coc-toml) version meta;
src = "${coc-toml}/lib/node_modules/coc-toml";
};
}

View File

@@ -0,0 +1,31 @@
{
symlinkJoin,
}:
final: prev: {
corePlugins = symlinkJoin {
name = "core-vim-plugins";
paths = with final; [
# plugin managers
lazy-nvim
mini-deps
packer-nvim
vim-plug
# core dependencies
plenary-nvim
# popular plugins
mini-nvim
nvim-cmp
nvim-lspconfig
nvim-treesitter
vim-airline
vim-fugitive
vim-surround
];
meta.description = "Collection of popular vim plugins (for internal testing purposes)";
};
}

View File

@@ -0,0 +1,75 @@
# TODO check that no license information gets lost
{
callPackage,
config,
lib,
vimUtils,
vim,
llvmPackages,
neovimUtils,
}:
let
inherit (vimUtils.override { inherit vim; })
buildVimPlugin
;
inherit (lib) extends;
initialPackages = self: { };
cocPlugins = callPackage ./cocPlugins.nix {
inherit buildVimPlugin;
};
luaPackagePlugins = callPackage ./luaPackagePlugins.nix {
inherit (neovimUtils) buildNeovimPlugin;
};
nodePackagePlugins = callPackage ./nodePackagePlugins.nix {
inherit buildVimPlugin;
};
nonGeneratedPlugins =
self: super:
let
root = ./non-generated;
call = name: callPackage (root + "/${name}") { };
in
lib.pipe root [
builtins.readDir
(lib.filterAttrs (_: type: type == "directory"))
(builtins.mapAttrs (name: _: call name))
];
plugins = callPackage ./generated.nix {
inherit buildVimPlugin;
inherit (neovimUtils) buildNeovimPlugin;
};
corePlugins = callPackage ./corePlugins.nix { };
# TL;DR
# * Add your plugin to ./vim-plugin-names
# * run ./update.py
#
# If additional modifications to the build process are required,
# add to ./overrides.nix.
overrides = callPackage ./overrides.nix {
inherit llvmPackages;
};
aliases = if config.allowAliases then (import ./aliases.nix lib) else final: prev: { };
in
lib.pipe initialPackages [
(extends plugins)
(extends cocPlugins)
(extends luaPackagePlugins)
(extends nodePackagePlugins)
(extends nonGeneratedPlugins)
(extends corePlugins)
(extends overrides)
(extends aliases)
lib.makeExtensible
]

View File

@@ -0,0 +1,122 @@
{
"TrueZen-nvim": {
"date": "2022-07-27",
"new": "true-zen-nvim"
},
"codeium-nvim": {
"date": "2025-04-09",
"new": "windsurf-nvim"
},
"codeium-vim": {
"date": "2025-04-09",
"new": "windsurf-vim"
},
"compe-conjure": {
"date": "2024-11-19",
"new": "cmp-conjure"
},
"compe-latex-symbols": {
"date": "2024-11-19",
"new": "cmp-latex-symbols"
},
"compe-tabnine": {
"date": "2024-11-19",
"new": "cmp-tabnine"
},
"compe-tmux": {
"date": "2021-12-07",
"new": "cmp-tmux"
},
"compe-zsh": {
"date": "2024-11-19",
"new": "cmp-zsh"
},
"fern-vim": {
"date": "2024-05-12",
"new": "vim-fern"
},
"gina-vim": {
"date": "2024-05-12",
"new": "vim-gina"
},
"gist-vim": {
"date": "2020-03-27",
"new": "vim-gist"
},
"lspsaga-nvim-original": {
"date": "2023-08-08",
"new": "lspsaga-nvim"
},
"lua-async-await": {
"date": "2025-01-09",
"new": "lua-async"
},
"lua-dev-nvim": {
"date": "2022-10-14",
"new": "neodev-nvim"
},
"magma-nvim-goose": {
"date": "2024-10-28",
"new": "magma-nvim"
},
"nvchad-extensions": {
"date": "2023-08-19",
"new": "nvchad-ui"
},
"nvim-base16": {
"date": "2024-02-15",
"new": "base16-nvim"
},
"nvim-bufferline-lua": {
"date": "2021-08-22",
"new": "bufferline-nvim"
},
"nvim-compe": {
"date": "2024-11-19",
"new": "nvim-cmp"
},
"nvim-lsp": {
"date": "2020-08-31",
"new": "nvim-lspconfig"
},
"nvim-toggleterm-lua": {
"date": "2021-08-22",
"new": "toggleterm-nvim"
},
"orgmode-nvim": {
"date": "2021-11-28",
"new": "orgmode"
},
"render-markdown": {
"date": "2024-09-16",
"new": "render-markdown-nvim"
},
"sql-nvim": {
"date": "2021-09-03",
"new": "sqlite-lua"
},
"suda-vim": {
"date": "2024-05-12",
"new": "vim-suda"
},
"taskwarrior": {
"date": "2024-08-13",
"new": "taskwarrior3 or taskwarrior2"
},
"vim-fsharp": {
"date": "2024-03-16",
"new": "zarchive-vim-fsharp"
},
"vim-jade": {
"date": "2020-03-27",
"new": "vim-pug"
},
"vundle": {
"date": "2020-03-27",
"new": "Vundle-vim"
},
"youcompleteme": {
"date": "2020-03-27",
"new": "YouCompleteMe"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
#shellcheck shell=bash
# Setup hook for checking whether Lua imports succeed
echo "Sourcing neovim-require-check-hook.sh"
# Discover modules automatically if nvimRequireCheck is not set
discover_modules() {
echo "Running module discovery in source directory..."
# Create unique lists so we can organize later
modules=()
while IFS= read -r lua_file; do
# Ignore certain infra directories
if [[ "$lua_file" =~ (^|/)(debug|script|scripts|test|tests|spec)(/|$) || "$lua_file" =~ .*\meta.lua ]]; then
continue
# Ignore optional telescope and lualine modules
elif [[ "$lua_file" =~ ^lua/telescope/_extensions/(.+)\.lua || "$lua_file" =~ ^lua/lualine/(.+)\.lua ]]; then
continue
# Grab main module names
elif [[ "$lua_file" =~ ^lua/([^/]+)/init.lua$ ]]; then
echo "$lua_file"
modules+=("${BASH_REMATCH[1]}")
# Check other lua files
elif [[ "$lua_file" =~ ^lua/(.*)\.lua$ ]]; then
echo "$lua_file"
# Replace slashes with dots to form the module name
module_name="${BASH_REMATCH[1]//\//.}"
modules+=("$module_name")
elif [[ "$lua_file" =~ ^([^/.][^/]*)\.lua$ ]]; then
echo "$lua_file"
modules+=("${BASH_REMATCH[1]}")
fi
done < <(find "$src" -name '*.lua' | xargs -n 1 realpath --relative-to="$src")
nvimRequireCheck=("${modules[@]}")
echo "Discovered modules: ${nvimRequireCheck[*]}"
if [ "${#nvimRequireCheck[@]}" -eq 0 ]; then
echo "No valid Lua modules found; skipping check"
return 1
fi
return 0
}
# Run require checks on each module in nvimRequireCheck
run_require_checks() {
echo "Starting require checks"
check_passed=false
failed_modules=()
successful_modules=()
export HOME="$TMPDIR"
local deps="${dependencies[*]}"
local nativeCheckInputs="${nativeBuildInputs[*]}"
local checkInputs="${buildInputs[*]}"
set +e
if [ -v 'nvimSkipModule' ]; then
nvimSkipModules=("${nvimSkipModule[@]}")
echo "WARNING: nvimSkipModule got renamed to nvimSkipModules, please update package $name"
fi
for name in "${nvimRequireCheck[@]}"; do
local skip=false
for module in "${nvimSkipModules[@]}"; do
if [[ "$module" == "$name" ]]; then
echo "$name is in list of modules to not check. Skipping..."
skip=true
break
fi
done
if [ "$skip" = false ]; then
echo "Attempting to require module: $name"
if @nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \
--cmd "set rtp+=$out,${deps// /,}" \
--cmd "set rtp+=$out,${nativeCheckInputs// /,}" \
--cmd "set rtp+=$out,${checkInputs// /,}" \
--cmd "lua require('$name')"; then
check_passed=true
successful_modules+=("$name")
echo "Successfully required module: $name"
else
echo "Failed to require module: $name"
failed_modules+=("$name")
fi
fi
done
set -e
}
# Define color codes
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
# Print summary of the require checks
print_summary() {
echo -e "\n======================================================"
if [[ "$check_passed" == "true" ]]; then
echo -e "${GREEN}Require check succeeded for the following modules:${NC}"
for module in "${successful_modules[@]}"; do
echo -e " ${GREEN}- $module${NC}"
done
echo "All lua modules were checked."
else
echo -e "${RED}No successful require checks.${NC}"
fi
# Print any modules that failed with improved formatting and color
if [ "${#failed_modules[@]}" -gt 0 ]; then
echo -e "\n${RED}Require check failed for the following modules:${NC}"
for module in "${failed_modules[@]}"; do
echo -e " ${RED}- $module${NC}"
done
echo -e "\n${RED}Checkout https://nixos.org/manual/nixpkgs/unstable/#testing-neovim-plugins-neovim-require-check${NC}"
fi
echo "======================================================"
if [ "${#failed_modules[@]}" -gt 0 ]; then
return 1
fi
}
# Main entry point: orchestrates discovery, require checks, and summary
neovimRequireCheckHook() {
echo "Executing neovimRequireCheckHook"
if [ "${nvimRequireCheck[*]}" = "" ]; then
echo "nvimRequireCheck is empty; entering discovery mode"
# Auto-discovery mode
if ! discover_modules; then
echo "No modules found during discovery; exiting hook"
return
fi
else
echo "nvimRequireCheck is pre-populated; entering manual check mode"
fi
run_require_checks
print_summary
}
echo "Using neovimRequireCheckHook"
appendToVar preDistPhases neovimRequireCheckHook

View File

@@ -0,0 +1,25 @@
# Setup hook for checking whether a vim command exists
echo "Sourcing vim-command-check-hook.sh"
vimCommandCheckHook () {
echo "Executing vimCommandCheckHook"
if [ -n "$vimCommandCheck" ]; then
echo "Check whether the following modules can be imported: $vimCommandCheck"
# editorconfig-checker-disable
export HOME="$TMPDIR"
@vimBinary@ -es -n -u NONE -i NONE --clean -V1 --cmd "set rtp+=$out" \
--cmd "runtime! plugin/*.vim" <<-EOF
if exists(":$vimCommandCheck") == 2
cquit 0
else
cquit 1
fi
EOF
fi
}
echo "Using vimCommandCheckHook"
appendToVar preDistPhases vimCommandCheckHook

View File

@@ -0,0 +1,30 @@
echo "Sourcing vim-gen-doc-hook"
# the doc folder is copied via the copy_directories entry of the rockspec
# in the folder gitsigns.nvim-scm-1-rocks/gitsigns.nvim/scm-1
vimPluginGenTags() {
echo "Executing vimPluginGenTags"
target="$out/@rtpPath@"
mkdir -p $out/@rtpPath@
# build help tags
if [ -d "$target/doc" ]; then
echo "Building help tags"
if ! @vimBinary@ -N -u NONE -i NONE -n -E -s -V1 -c "helptags $target/doc" +quit!; then
echo "Failed to build help tags!"
exit 1
fi
else
echo "No docs available for $target"
fi
if [ -n "$addonInfo" ]; then
echo "$addonInfo" > $target/addon-info.json
fi
echo "Finished executing vimPluginGenTags"
}
preFixupHooks+=(vimPluginGenTags)

View File

@@ -0,0 +1,51 @@
{
lib,
buildNeovimPlugin,
neovim-unwrapped,
}:
final: prev:
let
luaPackages = neovim-unwrapped.lua.pkgs;
luarocksPackageNames = [
"fidget-nvim"
"fzf-lua"
"gitsigns-nvim"
"grug-far-nvim"
"haskell-tools-nvim"
"image-nvim"
"lsp-progress-nvim"
"lualine-nvim"
"luasnip"
"lush-nvim"
"lz-n"
"lze"
"lzextras"
"lzn-auto-require"
"middleclass"
"mini-test"
"neorg"
"neotest"
"nui-nvim"
"nvim-cmp"
"nvim-nio"
"nvim-web-devicons"
"oil-nvim"
"orgmode"
"papis-nvim"
"plenary-nvim"
"rest-nvim"
"rocks-config-nvim"
"rocks-nvim"
"rustaceanvim"
"rtp-nvim"
"telescope-manix"
"telescope-nvim"
];
in
lib.genAttrs luarocksPackageNames (
name:
buildNeovimPlugin {
luaAttr = luaPackages.${name};
}
)

View File

@@ -0,0 +1,58 @@
{
lib,
buildVimPlugin,
nodePackages,
}:
final: prev:
let
nodePackageNames = [
"coc-cmake"
"coc-emmet"
"coc-eslint"
"coc-flutter"
"coc-go"
"coc-haxe"
"coc-highlight"
"coc-html"
"coc-java"
"coc-jest"
"coc-json"
"coc-lists"
"coc-ltex"
"coc-markdownlint"
"coc-pairs"
"coc-prettier"
"coc-r-lsp"
"coc-rust-analyzer"
"coc-smartf"
"coc-snippets"
"coc-solargraph"
"coc-sqlfluff"
"coc-stylelint"
"coc-sumneko-lua"
"coc-tabnine"
"coc-texlab"
"coc-tsserver"
"coc-ultisnips"
"coc-vimlsp"
"coc-vimtex"
"coc-wxml"
"coc-yaml"
"coc-yank"
"coc-nginx"
];
packageNameOverrides = {
"coc-nginx" = "@yaegassy/coc-nginx";
};
getPackageName = name: packageNameOverrides.${name} or name;
in
lib.genAttrs nodePackageNames (
name:
buildVimPlugin {
pname = name;
inherit (nodePackages.${getPackageName name}) version meta;
src = "${nodePackages.${getPackageName name}}/lib/node_modules/${getPackageName name}";
}
)

View File

@@ -0,0 +1,55 @@
{
lib,
fetchFromGitHub,
nix-update-script,
rustPlatform,
vimUtils,
}:
let
version = "0.1.161";
src = fetchFromGitHub {
owner = "autozimu";
repo = "LanguageClient-neovim";
tag = version;
hash = "sha256-Z9S2ie9RxJCIbmjSV/Tto4lK04cZfWmK3IAy8YaySVI=";
};
LanguageClient-neovim-bin = rustPlatform.buildRustPackage {
pname = "LanguageClient-neovim-bin";
inherit version src;
cargoPatches = [
./traitobject.patch
];
cargoHash = "sha256-43alR84MktYTmsKeUMm4gK8AjUIkGqcsuFeQPusBKD0=";
};
in
vimUtils.buildVimPlugin {
pname = "LanguageClient-neovim";
inherit version src;
propagatedBuildInputs = [ LanguageClient-neovim-bin ];
preFixup = ''
substituteInPlace "$out"/autoload/LanguageClient.vim \
--replace-fail \
"let l:path = s:root . '/bin/'" \
"let l:path = '${LanguageClient-neovim-bin}' . '/bin/'"
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex=(\\d+\\.\\d+\\.\\d+)" ];
attrPath = "vimPlugins.LanguageClient-neovim.LanguageClient-neovim-bin";
};
# needed for the update script
inherit LanguageClient-neovim-bin;
};
meta = {
homepage = "https://github.com/autozimu/LanguageClient-neovim/";
changelog = "https://github.com/autozimu/LanguageClient-neovim/releases/tag/${src.tag}";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,15 @@
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1026,9 +1028,9 @@ dependencies = [
[[package]]
name = "traitobject"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
+checksum = "04a79e25382e2e852e8da874249358d382ebaf259d0d34e75d8db16a7efabbc7"
[[package]]
name = "treediff"

View File

@@ -0,0 +1,103 @@
{
lib,
fetchFromGitHub,
nix-update-script,
openssl,
pkg-config,
rustPlatform,
stdenv,
vimPlugins,
vimUtils,
makeWrapper,
pkgs,
}:
let
version = "0.0.27-unstable-2025-10-06";
src = fetchFromGitHub {
owner = "yetone";
repo = "avante.nvim";
rev = "a7052aca0bdfb93e524f0536ac80e6c542962f47";
hash = "sha256-crtzBzRcpuqQdqymUJMAxky1Lfk+6YY0YifThHXz7Rw=";
};
avante-nvim-lib = rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
inherit version src;
cargoHash = "sha256-pTWCT2s820mjnfTscFnoSKC37RE7DAPKxP71QuM+JXQ=";
nativeBuildInputs = [
pkg-config
makeWrapper
pkgs.perl
];
buildInputs = [
openssl
];
buildFeatures = [ "luajit" ];
checkFlags = [
# Disabled because they access the network.
"--skip=test_hf"
"--skip=test_public_url"
"--skip=test_roundtrip"
"--skip=test_fetch_md"
];
};
in
vimUtils.buildVimPlugin {
pname = "avante.nvim";
inherit version src;
dependencies = with vimPlugins; [
dressing-nvim
img-clip-nvim
nui-nvim
nvim-treesitter
plenary-nvim
];
postInstall =
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
mkdir -p $out/build
ln -s ${avante-nvim-lib}/lib/libavante_repo_map${ext} $out/build/avante_repo_map${ext}
ln -s ${avante-nvim-lib}/lib/libavante_templates${ext} $out/build/avante_templates${ext}
ln -s ${avante-nvim-lib}/lib/libavante_tokenizers${ext} $out/build/avante_tokenizers${ext}
ln -s ${avante-nvim-lib}/lib/libavante_html2md${ext} $out/build/avante_html2md${ext}
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
attrPath = "vimPlugins.avante-nvim.avante-nvim-lib";
};
# needed for the update script
inherit avante-nvim-lib;
};
nvimSkipModules = [
# Requires setup with corresponding provider
"avante.providers.azure"
"avante.providers.copilot"
"avante.providers.gemini"
"avante.providers.ollama"
"avante.providers.vertex"
"avante.providers.vertex_claude"
];
meta = {
description = "Neovim plugin designed to emulate the behaviour of the Cursor AI IDE";
homepage = "https://github.com/yetone/avante.nvim";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
ttrei
aarnphm
jackcres
];
};
}

View File

@@ -0,0 +1,21 @@
{
vimUtils,
fetchFromGitHub,
}:
vimUtils.buildVimPlugin rec {
pname = "bitbake-vim";
version = "2.10.4";
# The tags are very messy on the upstream repo. We prefer disabling automatic updates for this plugin.
# nixpkgs-update: no auto update
src = fetchFromGitHub {
owner = "openembedded";
repo = "bitbake";
tag = version;
hash = "sha256-gdxPnRhd4Hj1PWgCU5A/+639ndJXlkdArOBZt6eiZWA=";
};
sourceRoot = "source/contrib/vim";
meta.homepage = "https://github.com/openembedded/bitbake/";
}

View File

@@ -0,0 +1,68 @@
{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
vimUtils,
nix-update-script,
gitMinimal,
}:
let
version = "1.7.0";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.cmp";
tag = "v${version}";
hash = "sha256-eMUOjG2CtedCGVU1Pdp8PCCgGoFbjeVvK7lMS8E+ogg=";
};
blink-fuzzy-lib = rustPlatform.buildRustPackage {
inherit version src;
pname = "blink-fuzzy-lib";
cargoHash = "sha256-zWZHT+Y8ENN/nFEtJnkEUHXRuU6FUQ/ITHo+V4zJ6f8=";
nativeBuildInputs = [ gitMinimal ];
env = {
# TODO: remove this if plugin stops using nightly rust
RUSTC_BOOTSTRAP = true;
};
};
in
vimUtils.buildVimPlugin {
pname = "blink.cmp";
inherit version src;
preInstall =
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.blink-cmp.blink-fuzzy-lib";
};
# needed for the update script
inherit blink-fuzzy-lib;
};
meta = {
description = "Performant, batteries-included completion plugin for Neovim";
homepage = "https://github.com/saghen/blink.cmp";
changelog = "https://github.com/Saghen/blink.cmp/blob/v${version}/CHANGELOG.md";
maintainers = with lib.maintainers; [
balssh
redxtech
llakala
];
};
nvimSkipModules = [
# Module for reproducing issues
"repro"
];
}

View File

@@ -0,0 +1,62 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
vimUtils,
stdenv,
nix-update-script,
}:
let
version = "0.3.0";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.pairs";
tag = "v${version}";
hash = "sha256-RTY/uGviyHlO+ZmLwOC5BabKr+kRDAXGZNdS9fVRPWA=";
};
blink-pairs-lib = rustPlatform.buildRustPackage {
pname = "blink-pairs";
inherit version src;
cargoHash = "sha256-j+zk0UMjvaVgsdF5iaRVO4Puf/XtGu08Cs92jKPaM1g=";
env.RUSTC_BOOTSTRAP = 1;
nativeBuildInputs = [
pkg-config
];
};
in
vimUtils.buildVimPlugin {
pname = "blink.pairs";
inherit version src;
preInstall =
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
mkdir -p target/release
ln -s ${blink-pairs-lib}/lib/libblink_pairs${ext} target/release/
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.blink-pairs.blink-pairs-lib";
};
# needed for the update script
inherit blink-pairs-lib;
};
meta = {
description = "Rainbow highlighting and intelligent auto-pairs for Neovim";
homepage = "https://github.com/Saghen/blink.pairs";
changelog = "https://github.com/Saghen/blink.pairs/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ isabelroses ];
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
fetchFromSourcehut,
nix-update-script,
vimUtils,
}:
vimUtils.buildVimPlugin {
pname = "clangd_extensions.nvim";
version = "0-unstable-2025-01-27";
src = fetchFromSourcehut {
owner = "~p00f";
repo = "clangd_extensions.nvim";
rev = "db28f29be928d18cbfb86fbfb9f83f584f658feb";
hash = "sha256-XdA638W0Zb85v5uAUNpvUiiQXGKOM2xykD2ClLk8Qpo=";
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Clangd's off-spec features for neovim's LSP client";
homepage = "https://git.sr.ht/~p00f/clangd_extensions.nvim";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,32 @@
{
lib,
vimUtils,
fetchFromGitea,
nix-update-script,
vimPlugins,
}:
vimUtils.buildVimPlugin {
pname = "cmp-async-path";
version = "0-unstable-2025-04-13";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "FelipeLema";
repo = "cmp-async-path";
rev = "0ed1492f59e730c366d261a5ad822fa37e44c325";
hash = "sha256-J1Iw7yNfvWq7Jul25Eyx4qk9lSiLpZt4TRvTYi1DXtk=";
};
checkInputs = [ vimPlugins.nvim-cmp ];
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
description = "Nvim-cmp source for filesystem paths with async processing";
homepage = "https://codeberg.org/FelipeLema/cmp-async-path/";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
pkg-config,
rustPlatform,
vimUtils,
libuv,
}:
let
version = "1.6.3";
src = fetchFromGitHub {
owner = "mistricky";
repo = "codesnap.nvim";
tag = "v${version}";
hash = "sha256-VHH1jQczzNFiH+5YflhU9vVCkEUoKciV/Z/n9DEZwiY=";
};
codesnap-lib = rustPlatform.buildRustPackage {
pname = "codesnap-lib";
inherit version src;
sourceRoot = "${src.name}/generator";
cargoHash = "sha256-tg4BO4tPzHhJTowL7RiAuBo4i440FehpGmnz9stTxfI=";
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
libuv.dev
];
};
in
vimUtils.buildVimPlugin {
pname = "codesnap.nvim";
inherit version src;
# - Remove the shipped pre-built binaries
# - Copy the resulting binary from the codesnap-lib derivation
# Note: the destination should be generator.so, even on darwin
# https://github.com/mistricky/codesnap.nvim/blob/main/scripts/build_generator.sh
postInstall =
let
extension = if stdenv.hostPlatform.isDarwin then "dylib" else "so";
in
''
rm -r $out/lua/*.so
cp ${codesnap-lib}/lib/libgenerator.${extension} $out/lua/generator.so
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.codesnap-nvim.codesnap-lib";
};
# needed for the update script
inherit codesnap-lib;
};
meta = {
homepage = "https://github.com/mistricky/codesnap.nvim/";
changelog = "https://github.com/mistricky/codesnap.nvim/releases/tag/${src.tag}";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
fetchFromGitHub,
rustPlatform,
versionCheckHook,
nix-update-script,
vimUtils,
}:
let
version = "2.2.7";
src = fetchFromGitHub {
owner = "vyfor";
repo = "cord.nvim";
tag = "v${version}";
hash = "sha256-SONErPOIaRltx51+GCsGtR0FDSWp/36x3lDbYLSMxXM=";
};
cord-server = rustPlatform.buildRustPackage {
pname = "cord";
inherit src version;
# The version in .github/server-version.txt differs from the one in Cargo.toml
postPatch = ''
substituteInPlace .github/server-version.txt \
--replace-fail "2.2.6" "${version}"
'';
cargoHash = "sha256-14u3rhpDYNKZ4YLoGp6OPeeXDo3EzGYO3yhE9BkDSC0=";
# cord depends on nightly features
RUSTC_BOOTSTRAP = 1;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = false;
meta.mainProgram = "cord";
};
in
vimUtils.buildVimPlugin {
pname = "cord.nvim";
inherit version src;
# Patch the logic used to find the path to the cord server
# This still lets the user set config.advanced.server.executable_path
# https://github.com/vyfor/cord.nvim/blob/v2.2.3/lua/cord/server/fs/init.lua#L10-L15
postPatch = ''
substituteInPlace lua/cord/server/fs/init.lua \
--replace-fail \
"or M.get_data_path()" \
"or '${cord-server}'"
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.cord-nvim.cord-nvim-rust";
};
# needed for the update script
inherit cord-server;
};
meta = {
homepage = "https://github.com/vyfor/cord.nvim";
license = lib.licenses.asl20;
changelog = "https://github.com/vyfor/cord.nvim/releases/tag/v${version}";
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}

View File

@@ -0,0 +1,14 @@
{
vimUtils,
ethersync,
}:
vimUtils.buildVimPlugin rec {
inherit (ethersync)
pname
version
src
meta
;
sourceRoot = "${src.name}/nvim-plugin";
}

View File

@@ -0,0 +1,14 @@
{
vimUtils,
fzf,
}:
# 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.
vimUtils.buildVimPlugin {
inherit (fzf) src version;
pname = "fzf";
postInstall = ''
ln -s ${fzf}/bin/fzf $target/bin/fzf
'';
}

View File

@@ -0,0 +1,29 @@
{
lib,
vimUtils,
fetchFromGitLab,
nix-update-script,
}:
let
version = "0.1.1";
in
vimUtils.buildVimPlugin {
pname = "gitlab.vim";
inherit version;
src = fetchFromGitLab {
owner = "gitlab-org/editor-extensions";
repo = "gitlab.vim";
rev = "v${version}";
hash = "sha256-W/FV+i/QJYX6A8uyxAQN4ov1kMd9UFCghFmSQp1kbnM=";
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Integrate GitLab Duo with Neovim";
homepage = "https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
vimUtils,
fetchFromSourcehut,
nix-update-script,
}:
vimUtils.buildVimPlugin {
pname = "hare.vim";
version = "0-unstable-2025-04-24";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "hare.vim";
rev = "41b8b615f46a39d807a9a069039aac79c925c389";
hash = "sha256-GPFoQI6tipcLzkvjaeufmMrNnQM46lPas9D1SwzjKF4=";
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Hare programming in Vim";
homepage = "https://git.sr.ht/~sircmpwn/hare.vim";
license = lib.licenses.vim;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,11 @@
{
vimUtils,
hurl,
}:
vimUtils.buildVimPlugin {
pname = "hurl";
inherit (hurl) version;
# https://hurl.dev/
src = "${hurl.src}/contrib/vim";
}

View File

@@ -0,0 +1,27 @@
{
lib,
fetchFromGitea,
vimUtils,
nix-update-script,
}:
vimUtils.buildVimPlugin {
pname = "jsonfly.nvim";
version = "0-unstable-2025-06-07";
src = fetchFromGitea {
domain = "git.myzel394.app";
owner = "Myzel394";
repo = "jsonfly.nvim";
rev = "db4394d856059d99d82ea2c75d033721e9dcb1fc";
hash = "sha256-PmYm+vZ0XONoHUo08haBozbXRpN+/LAlr6Fyg7anTNw=";
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Search blazingly fast for JSON / XML / YAML keys via Telescope";
homepage = "https://git.myzel394.app/Myzel394/jsonfly.nvim";
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ myzel394 ];
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
vimUtils,
fetchFromSourcehut,
nix-update-script,
}:
let
version = "3.0.0";
in
vimUtils.buildVimPlugin {
pname = "lsp_lines.nvim";
inherit version;
src = fetchFromSourcehut {
owner = "~whynothugo";
repo = "lsp_lines.nvim";
rev = "v${version}";
hash = "sha256-QsvmPOer7JgO7Y+N/iaNJD7Kmy69gnlV4CeyaQesNvA=";
};
passthru.updateScript = nix-update-script { };
meta = {
description = "Neovim diagnostics using virtual lines";
homepage = "https://git.sr.ht/~whynothugo/lsp_lines.nvim";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,10 @@
{
lib,
vimUtils,
meson,
}:
vimUtils.buildVimPlugin {
inherit (meson) pname version src;
preInstall = "cd data/syntax-highlighting/vim";
meta.maintainers = with lib.maintainers; [ vcunat ];
}

View File

@@ -0,0 +1,362 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "bitflags"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bstr"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"memchr",
]
[[package]]
name = "cc"
version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e"
dependencies = [
"shlex",
]
[[package]]
name = "either"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "erased-serde"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c"
dependencies = [
"serde",
]
[[package]]
name = "errno"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "home"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf"
dependencies = [
"windows-sys",
]
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "linux-raw-sys"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]]
name = "lua-src"
version = "546.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2da0daa7eee611a4c30c8f5ee31af55266e26e573971ba9336d2993e2da129b2"
dependencies = [
"cc",
]
[[package]]
name = "luajit-src"
version = "210.4.8+resty107baaf"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e05167e8b2a2185758d83ed23541e5bd8bce37072e4204e0ef2c9b322bc87c4e"
dependencies = [
"cc",
"which",
]
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "mlua"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb37b0ba91f017aa7ca2b98ef99496827770cd635b4a932a6047c5b4bbe678e"
dependencies = [
"bstr",
"cc",
"erased-serde",
"lua-src",
"luajit-src",
"mlua_derive",
"num-traits",
"once_cell",
"pkg-config",
"rustc-hash",
"serde",
]
[[package]]
name = "mlua_derive"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9214e60d3cf1643013b107330fcd374ccec1e4ba1eef76e7e5da5e8202e71c0"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "moveline"
version = "0.3.1"
dependencies = [
"mlua",
"nvim-utils",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "nvim-utils"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9a92389a7a9f1352c8e4f739f854d09430e5b13007a22ad71bb68cea656031"
dependencies = [
"mlua",
"nvim-utils-macros",
"serde",
]
[[package]]
name = "nvim-utils-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786ceed33fafdafb3933d708ddbb669eb41949b8d52c58e13fb5ec5b815da06a"
dependencies = [
"mlua",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "pkg-config"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]]
name = "proc-macro2"
version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustix"
version = "0.38.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85"
dependencies = [
"bitflags",
"errno",
"libc",
"linux-raw-sys",
"windows-sys",
]
[[package]]
name = "serde"
version = "1.0.216"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.216"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.90",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
[[package]]
name = "which"
version = "4.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
dependencies = [
"either",
"home",
"once_cell",
"rustix",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"

View File

@@ -0,0 +1,54 @@
{
lib,
fetchFromGitHub,
rustPlatform,
vimUtils,
stdenv,
}:
let
version = "0.3.1-unstable-2023-07-06";
src = fetchFromGitHub {
owner = "willothy";
repo = "moveline.nvim";
rev = "570603637be8af20e97b91cf554fef29cab73ca6";
hash = "sha256-hq/n48JC1EgJbmb6b/1jQ8MNhbcsJD3wIYaKE1UiU30=";
};
moveline-lib = rustPlatform.buildRustPackage {
inherit src version;
pname = "moveline-lib";
# Upstream doesn't contain a cargo lock
cargoLock = {
lockFile = ./Cargo.lock;
};
postPatch = ''
ln -s ${./Cargo.lock} Cargo.lock
'';
};
in
vimUtils.buildVimPlugin {
inherit src version;
pname = "moveline-nvim";
preInstall =
# https://github.com/neovim/neovim/issues/21749
# Need to still copy generated library as `so` because neovim doesn't check for `dylib`
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
mkdir -p lua
ln -s ${moveline-lib}/lib/libmoveline${ext} lua/moveline.so
'';
# Plugin generates a non lua file output that needs to be manually required
nvimRequireCheck = "moveline";
meta = {
description = "Neovim plugin for moving lines up and down";
homepage = "https://github.com/willothy/moveline.nvim";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ redxtech ];
};
}

View File

@@ -0,0 +1 @@
{ notmuch }: notmuch.vim

View File

@@ -0,0 +1,70 @@
{
lib,
buildGoModule,
fetchFromGitHub,
arrow-cpp,
duckdb,
nix-update-script,
stdenv,
vimPlugins,
vimUtils,
}:
let
version = "0.1.9";
src = fetchFromGitHub {
owner = "kndndrj";
repo = "nvim-dbee";
tag = "v${version}";
hash = "sha256-AOime4vG0NFcUvsd9Iw5SxR7WaeCsoCRU6h5+vSkt4M=";
};
dbee-bin = buildGoModule {
pname = "dbee-bin";
inherit version;
inherit src;
sourceRoot = "${src.name}/dbee";
vendorHash = "sha256-U/3WZJ/+Bm0ghjeNUILsnlZnjIwk3ySaX3Rd4L9Z62A=";
buildInputs = [
arrow-cpp
duckdb
];
# Tests attempt to access `/etc/protocols` which is forbidden in the sandbox
doCheck = !stdenv.hostPlatform.isDarwin;
meta.mainProgram = "dbee";
};
in
vimUtils.buildVimPlugin {
pname = "nvim-dbee";
inherit version src;
postPatch = ''
substituteInPlace lua/dbee/install/init.lua \
--replace-fail 'return vim.fn.stdpath("data") .. "/dbee/bin"' 'return "${dbee-bin}/bin"'
'';
preFixup = ''
mkdir $target/bin
ln -s ${lib.getExe dbee-bin} $target/bin/dbee
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.nvim-dbee.dbee-bin";
};
# needed for the update script
inherit dbee-bin;
};
dependencies = [ vimPlugins.nui-nvim ];
meta = {
description = "Interactive database client for neovim";
homepage = "https://github.com/kndndrj/nvim-dbee";
changelog = "https://github.com/kndndrj/nvim-dbee/releases/tag/v${version}";
maintainers = with lib.maintainers; [ perchun ];
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
vimUtils,
fetchFromGitLab,
nix-update-script,
}:
vimUtils.buildVimPlugin {
pname = "nvim-julia-autotest";
version = "0-unstable-2022-10-31";
src = fetchFromGitLab {
owner = "usmcamp0811";
repo = "nvim-julia-autotest";
rev = "b74e2f9c961e604cb56cc23f87188348bfa0f33f";
hash = "sha256-IaNsbBe5q7PB9Q/N/Z9nEnP6jlkQ6+xlkC0TCFnJpkk=";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
description = "Automatically run Julia tests when you save runtest.jl file";
homepage = "https://gitlab.com/usmcamp0811/nvim-julia-autotest";
license = lib.licenses.gpl3;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,59 @@
{
lib,
fetchFromGitHub,
nix-update-script,
rustPlatform,
vimPlugins,
vimUtils,
}:
let
version = "0-unstable-2025-05-13";
src = fetchFromGitHub {
owner = "nvim-pack";
repo = "nvim-spectre";
rev = "72f56f7585903cd7bf92c665351aa585e150af0f";
hash = "sha256-WPEizIClDmseDEhomCasLx/zfAMT7lq7ZBnfc/a8CuA=";
};
spectre_oxi = rustPlatform.buildRustPackage {
pname = "spectre_oxi";
inherit version src;
sourceRoot = "${src.name}/spectre_oxi";
cargoHash = "sha256-0szVL45QRo3AuBMf+WQ0QF0CS1B9HWPxfF6l6TJtv6Q=";
preCheck = ''
mkdir tests/tmp/
'';
checkFlags = [
# Flaky test (https://github.com/nvim-pack/nvim-spectre/issues/244)
"--skip=tests::test_replace_simple"
];
};
in
vimUtils.buildVimPlugin {
pname = "nvim-spectre";
inherit version src;
dependencies = [ vimPlugins.plenary-nvim ];
postInstall = ''
ln -s ${spectre_oxi}/lib/libspectre_oxi.* $out/lua/spectre_oxi.so
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
attrPath = "vimPlugins.nvim-spectre.spectre_oxi";
};
# needed for the update script
inherit spectre_oxi;
};
meta = {
homepage = "https://github.com/nvim-pack/nvim-spectre/";
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,5 @@
{
lib,
vimPlugins,
}:
lib.recurseIntoAttrs vimPlugins.nvim-treesitter.grammarPlugins

View File

@@ -0,0 +1 @@
{ parinfer-rust }: parinfer-rust

View File

@@ -0,0 +1,16 @@
{
vimUtils,
phpactor,
}:
vimUtils.buildVimPlugin {
inherit (phpactor)
pname
src
meta
version
;
postPatch = ''
substituteInPlace plugin/phpactor.vim \
--replace-fail "g:phpactorpath = expand('<sfile>:p:h') . '/..'" "g:phpactorpath = '${phpactor}'"
'';
}

View File

@@ -0,0 +1,33 @@
{
lib,
vimUtils,
fetchFromGitLab,
nix-update-script,
}:
vimUtils.buildVimPlugin rec {
pname = "rainbow-delimiters.nvim";
version = "0.10.0";
src = fetchFromGitLab {
owner = "HiPhish";
repo = "rainbow-delimiters.nvim";
tag = "v${version}";
hash = "sha256-E0ZPi9Vzc3TwhNHsGyABY+sgn/vO6Oyun6eRd7/RFgU=";
};
nvimSkipModules = [
# rainbow-delimiters.types.lua
"rainbow-delimiters.types"
# Test that requires an unpackaged dependency
"rainbow-delimiters._test.highlight"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Rainbow delimiters for Neovim with Tree-sitter";
homepage = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim";
license = lib.licenses.gpl3;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
fetchFromGitHub,
nix-update-script,
openssl,
pkg-config,
rustPlatform,
vimPlugins,
vimUtils,
}:
let
version = "1.1.0-unstable-2025-01-21";
src = fetchFromGitHub {
owner = "sourcegraph";
repo = "sg.nvim";
rev = "775f22b75a9826eabf69b0094dd1d51d619fe552";
hash = "sha256-i5g+pzxB8pAORLbr1wlYWUTsrJJmVj9UwlCg8pU3Suw=";
};
sg-nvim-rust = rustPlatform.buildRustPackage {
pname = "sg-nvim-rust";
inherit version src;
cargoHash = "sha256-yY/5w2ztmTKJAYDxBJND8itCOwRNi1negiFq3PyFaSM=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
prePatch = ''
rm .cargo/config.toml
'';
env.OPENSSL_NO_VENDOR = true;
cargoBuildFlags = [ "--workspace" ];
# tests are broken
doCheck = false;
};
in
vimUtils.buildVimPlugin {
pname = "sg.nvim";
inherit version src;
checkInputs = with vimPlugins; [
telescope-nvim
nvim-cmp
];
dependencies = [ vimPlugins.plenary-nvim ];
postInstall = ''
mkdir -p $out/target/debug
ln -s ${sg-nvim-rust}/{bin,lib}/* $out/target/debug
'';
nvimSkipModules = [
# Dependent on active fuzzy search state
"sg.cody.fuzzy"
];
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
attrPath = "vimPlugins.sg-nvim.sg-nvim-rust";
};
# needed for the update script
inherit sg-nvim-rust;
};
meta = {
description = "Neovim plugin designed to emulate the behaviour of the Cursor AI IDE";
homepage = "https://github.com/sourcegraph/sg.nvim/";
license = lib.licenses.asl20;
};
}

View File

@@ -0,0 +1,9 @@
{
vimUtils,
skim,
}:
vimUtils.buildVimPlugin {
pname = "skim";
inherit (skim) version;
src = skim.vim;
}

View File

@@ -0,0 +1,82 @@
{
lib,
fetchFromGitHub,
# sniprun-bin
rustPlatform,
makeWrapper,
bashInteractive,
coreutils,
curl,
gnugrep,
gnused,
procps,
# sniprun
vimUtils,
replaceVars,
nix-update-script,
}:
let
version = "1.3.19";
src = fetchFromGitHub {
owner = "michaelb";
repo = "sniprun";
tag = "v${version}";
hash = "sha256-a2hEV83NOnt+9BwDk94Ns+rIC9DeHFdu2dZG1XPtdnY=";
};
sniprun-bin = rustPlatform.buildRustPackage {
pname = "sniprun-bin";
inherit version src;
cargoHash = "sha256-Ps9Ugq8ISbuXO3Dxo1WQUVPCxf24oSHvem2Xg0sIgOQ=";
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/sniprun \
--prefix PATH ${
lib.makeBinPath [
bashInteractive
coreutils
curl
gnugrep
gnused
procps
]
}
'';
doCheck = false;
meta.mainProgram = "sniprun";
};
in
vimUtils.buildVimPlugin {
pname = "sniprun";
inherit version src;
patches = [
(replaceVars ./fix-paths.patch {
sniprun = lib.getExe sniprun-bin;
})
];
propagatedBuildInputs = [ sniprun-bin ];
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.sniprun.sniprun-bin";
};
# needed for the update script
inherit sniprun-bin;
};
meta = {
homepage = "https://github.com/michaelb/sniprun/";
changelog = "https://github.com/michaelb/sniprun/blob/v${version}/CHANGELOG.md";
maintainers = with lib.maintainers; [ GaetanLepage ];
license = lib.licenses.mit;
};
}

View File

@@ -0,0 +1,15 @@
diff --git a/lua/sniprun.lua b/lua/sniprun.lua
index 49be442..9342351 100644
--- a/lua/sniprun.lua
+++ b/lua/sniprun.lua
@@ -3,9 +3,7 @@ M.ping_anwsered = 0
M.info_floatwin = {}
-- See https://github.com/tjdevries/rofl.nvim/blob/632c10f2ec7c56882a3f7eda8849904bcac6e8af/lua/rofl.lua
-local binary_path = vim.fn.fnamemodify(
- vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":h:h")
- .. "/target/release/sniprun"
+local binary_path = "@sniprun@"
local sniprun_path = vim.fn.fnamemodify(vim.api.nvim_get_runtime_file("lua/sniprun.lua", false)[1], ":p:h") .. "/.."

View File

@@ -0,0 +1,28 @@
{
lib,
vimUtils,
fetchFromGitLab,
nix-update-script,
}:
vimUtils.buildVimPlugin {
pname = "sonarlint.nvim";
version = "0-unstable-2025-10-04";
src = fetchFromGitLab {
owner = "schrieveslaach";
repo = "sonarlint.nvim";
rev = "1d49a469265e271f02b6efcf09c215e4560bd5fa";
hash = "sha256-1eUwgHvegULo33xVjvV3b90fSlJ8Ax10iDCZE4IPo58=";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
homepage = "https://gitlab.com/schrieveslaach/sonarlint.nvim";
description = "Extensions for the built-in Language Server Protocol support in Neovim for sonarlint-language-server";
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.sinics ];
};
}

View File

@@ -0,0 +1,17 @@
{
vimUtils,
statix,
}:
vimUtils.buildVimPlugin rec {
inherit (statix) pname src meta;
version = "0.1.0";
postPatch = ''
# check that version is up to date
grep 'pname = "statix-vim"' -A 1 flake.nix \
| grep -F 'version = "${version}"'
cd vim-plugin
substituteInPlace ftplugin/nix.vim --replace-fail statix ${statix}/bin/statix
substituteInPlace plugin/statix.vim --replace-fail statix ${statix}/bin/statix
'';
}

View File

@@ -0,0 +1,8 @@
{
vimUtils,
taskwarrior2,
}:
vimUtils.buildVimPlugin {
inherit (taskwarrior2) version pname;
src = "${taskwarrior2.src}/scripts/vim";
}

View File

@@ -0,0 +1,8 @@
{
vimUtils,
taskwarrior3,
}:
vimUtils.buildVimPlugin {
inherit (taskwarrior3) version pname;
src = "${taskwarrior3.src}/scripts/vim";
}

View File

@@ -0,0 +1,21 @@
{
lib,
vimUtils,
tup,
}:
let
# Based on the comment at the top of https://github.com/gittup/tup/blob/master/contrib/syntax/tup.vim
ftdetect = builtins.toFile "tup.vim" ''
au BufNewFile,BufRead Tupfile,*.tup setf tup
'';
in
vimUtils.buildVimPlugin {
inherit (tup) pname version src;
preInstall = ''
mkdir -p vim-plugin/syntax vim-plugin/ftdetect
cp contrib/syntax/tup.vim vim-plugin/syntax/tup.vim
cp "${ftdetect}" vim-plugin/ftdetect/tup.vim
cd vim-plugin
'';
meta.maintainers = with lib.maintainers; [ enderger ];
}

View File

@@ -0,0 +1,40 @@
{
lib,
vimUtils,
vectorcode,
vimPlugins,
}:
let
inherit (vectorcode) src version;
in
vimUtils.buildVimPlugin {
inherit src version;
pname = "vectorcode.nvim";
# nixpkgs-update: no auto update
# This is built from the same source as vectorcode and will rebuild automatically
sourceRoot = "${src.name}/plugin";
dependencies = [
vimPlugins.plenary-nvim
];
buildInputs = [ vectorcode ];
postPatch = ''
cp -r ../lua .
'';
checkInputs = [
vimPlugins.codecompanion-nvim
];
meta = {
description = "Index and navigate your code repository using vectorcode";
homepage = "https://github.com/Davidyz/VectorCode/blob/main/docs/neovim.md";
inherit (vectorcode.meta) changelog license;
maintainers = with lib.maintainers; [ sarahec ];
};
}

View File

@@ -0,0 +1,72 @@
{
lib,
rustPlatform,
fetchFromGitHub,
fetchpatch,
pkg-config,
libgit2,
zlib,
vimUtils,
nix-update-script,
}:
let
version = "0.54";
src = fetchFromGitHub {
owner = "liuchengxu";
repo = "vim-clap";
tag = "v${version}";
hash = "sha256-rhCum59GCIAwdi5QgSaPfrALelAIMncNetu81i53Q8c=";
};
meta = with lib; {
description = "Modern performant fuzzy picker for Vim and NeoVim";
mainProgram = "maple";
homepage = "https://github.com/liuchengxu/vim-clap";
changelog = "https://github.com/liuchengxu/vim-clap/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = [ ];
};
maple = rustPlatform.buildRustPackage {
pname = "maple";
inherit version src meta;
cargoHash = "sha256-FEeSwa8KmIyfhWAU9Dpric6uB2e0yK+Tig/k2zwq2Rg=";
nativeBuildInputs = [
pkg-config
];
# Remove after next release
cargoPatches = [
(fetchpatch {
name = "rust-1.80";
url = "https://github.com/liuchengxu/vim-clap/commit/3e8d001f5c9be10e4bb680a1d409326902c96c10.patch";
hash = "sha256-qMflfQEssH4OGXmLFUcQwzbYWgPD0S/pClb35ZRUaPM=";
})
];
buildInputs = [
libgit2
zlib
];
};
in
vimUtils.buildVimPlugin {
pname = "vim-clap";
inherit version src meta;
postInstall = ''
ln -s ${maple}/bin/maple $out/bin/maple
'';
passthru = {
inherit maple;
updateScript = nix-update-script {
attrPath = "vimPlugins.vim-clap.maple";
};
};
}

View File

@@ -0,0 +1,52 @@
{
fetchFromGitHub,
nix-update-script,
rustPlatform,
vimUtils,
}:
let
version = "0-unstable-2022-06-14";
src = fetchFromGitHub {
owner = "euclio";
repo = "vim-markdown-composer";
rev = "e6f99bc20cfcb277c63041b1f766e6d5940bcc76";
sha256 = "0ljv8cvca8nk91g67mnzip81say04b1wbj9bzcgzy8m6qkz1r2h3";
fetchSubmodules = true;
};
vim-markdown-composer-bin = rustPlatform.buildRustPackage {
pname = "vim-markdown-composer-bin";
inherit src version;
cargoHash = "sha256-xzlEIaDEYDbxJ6YqzF+lSHcB9O+brClw026YI1YeNUc=";
# tests require network access
doCheck = false;
};
in
vimUtils.buildVimPlugin {
pname = "vim-markdown-composer";
inherit version src;
preFixup = ''
substituteInPlace "$out"/after/ftplugin/markdown/composer.vim \
--replace-fail \
"s:plugin_root . '/target/release/markdown-composer'" \
"'${vim-markdown-composer-bin}/bin/markdown-composer'"
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
attrPath = "vimPlugins.vim-markdown-composer.vim-markdown-composer-bin";
};
# needed for the update script
inherit vim-markdown-composer-bin;
};
meta = {
homepage = "https://github.com/euclio/vim-markdown-composer/";
# rust build error
broken = true;
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
vimUtils,
fetchFromGitLab,
nix-update-script,
}:
vimUtils.buildVimPlugin {
pname = "vim-ic10";
version = "0-unstable-2025-01-08";
src = fetchFromGitLab {
owner = "LittleMorph";
repo = "vim-ic10";
rev = "7c1f13b198cfe122fb52f6abfb8dc95d5ca51013";
hash = "sha256-4Q1JiDA7PBUWNBNfCIZC6nImhe2FJzOqrslHazAOs18=";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
description = "Stationeers IC10 syntax highlighting for Vim";
homepage = "https://gitlab.com/LittleMorph/vim-ic10";
license = lib.licenses.mit;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,10 @@
{
vimPlugins,
vimUtils,
}:
vimUtils.buildVimPlugin {
pname = "vim2nix";
version = "1.0";
src = ./src;
dependencies = [ vimPlugins.vim-addon-manager ];
}

View File

@@ -0,0 +1,3 @@
Usage see vim-utils.nix in nixpkgs
This code depends on vim-addon-manager

View File

@@ -0,0 +1 @@
{'dependencies': {'vim-addon-manager': {}}}

View File

@@ -0,0 +1,307 @@
" usage example:
"
" call nix#ExportPluginsForNix({'path_to_nixpkgs': '/etc/nixos/nixpkgs', 'names': ["vim-addon-manager", "vim-addon-nix"], 'cache_file': 'cache'})
let s:plugin_root = expand('<sfile>:h:h')
fun! nix#ToNixAttrName(s) abort
return nix#ToNixName(a:s)
endf
fun! nix#ToNixName(s) abort
return substitute(substitute(a:s, '[:/.]', '-', 'g'), 'github-', '', 'g')
endf
fun! s:System(...)
let args = a:000
let r = call('vam#utils#System', args)
if r is 0
throw "command ".join(args, '').' failed'
else
return r
endif
endf
fun! nix#DependenciesFromCheckout(opts, name, repository, dir)
" check for dependencies
" vam#PluginDirFromName(a:name)
let info = vam#ReadAddonInfo(vam#AddonInfoFile(a:dir, a:name))
return keys(get(info, 'dependencies', {}))
endf
" without deps
fun! nix#NixDerivation(opts, name, repository) abort
let n_a_name = nix#ToNixAttrName(a:name)
let n_n_name = nix#ToNixName(a:name)
let type = get(a:repository, 'type', '')
let created_notice = " # created by nix#NixDerivation"
let ancf = s:plugin_root.'/additional-nix-code/'.a:name
let additional_nix_code = file_readable(ancf) ? join(readfile(ancf), "\n") : ""
if type == 'git'
" should be using shell abstraction ..
echo 'fetching '. a:repository.url
let s = s:System('$ --fetch-submodules $ 2>&1',a:opts.nix_prefetch_git, a:repository.url)
let rev = matchstr(s, 'git revision is \zs[^\n\r]\+\ze')
let sha256 = matchstr(s, 'hash is \zs[^\n\r]\+\ze')
let dir = matchstr(s, 'path is \zs[^\n\r]\+\ze')
let date = matchstr(s, 'Commit date is \zs[0-9-]\+\ze')
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.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'-'.date.'";',
\ ' src = fetchgit {',
\ ' url = "'. a:repository.url .'";',
\ ' rev = "'.rev.'";',
\ ' sha256 = "'.sha256.'";',
\ ' };',
\ ' dependencies = ['.join(map(copy(dependencies), "'\"'.nix#ToNixAttrName(v:val).'\"'")).'];',
\ additional_nix_code,
\ ' };',
\ '',
\ '',
\ ], "\n")}
elseif type == 'hg'
" should be using shell abstraction ..
echo 'fetching '. a:repository.url
let s = s:System('$ $ 2>&1',a:opts.nix_prefetch_hg, a:repository.url)
let rev = matchstr(s, 'hg revision is \zs[^\n\r]\+\ze')
let sha256 = matchstr(s, 'hash is \zs[^\n\r]\+\ze')
let dir = matchstr(s, 'path is \zs[^\n\r]\+\ze')
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.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'";',
\ ' src = fetchhg {',
\ ' url = "'. a:repository.url .'";',
\ ' rev = "'.rev.'";',
\ ' sha256 = "'.sha256.'";',
\ ' };',
\ ' dependencies = ['.join(map(copy(dependencies), "'\"'.nix#ToNixAttrName(v:val).'\"'")).'];',
\ additional_nix_code,
\ ' };',
\ '',
\ '',
\ ], "\n")}
elseif type == 'archive'
let sha256 = split(s:System('nix-prefetch-url $ 2>/dev/null', a:repository.url), "\n")[0]
" we should unpack the sources, look for the addon-info.json file ..
" however most packages who have the addon-info.json file also are on
" github thus will be of type "git" instead. The dependency information
" from vim-pi is encoded in the reposiotry. Thus this is likely to do the
" right thing most of the time.
let addon_info = get(a:repository, 'addon-info', {})
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.' = buildVimPlugin {'.created_notice,
\ ' name = "'.n_n_name.'";',
\ ' src = fetchurl {',
\ ' url = "'. a:repository.url .'";',
\ ' name = "'. a:repository.archive_name .'";',
\ ' sha256 = "'.sha256.'";',
\ ' };',
\ ' buildInputs = [ unzip ];',
\ ' dependencies = ['.join(map(copy(dependencies), "'\"'.nix#ToNixAttrName(v:val).'\"'")).'];',
\ ' meta = {',
\ ' homepage = "http://www.vim.org/scripts/script.php?script_id='.a:repository.vim_script_nr.'";',
\ ' };',
\ addon_info == {} ? '' : (' addon_info = '.nix#ToNix(string(addon_info), [], "").';'),
\ additional_nix_code,
\ ' };',
\ '',
\ '',
\ ], "\n")}
else
throw a:name.' TODO: implement source '.string(a:repository)
endif
endf
" also tries to handle dependencies
fun! nix#AddNixDerivation(opts, cache, name, ...) abort
if has_key(a:cache, a:name) | return | endif
let repository = a:0 > 0 ? a:1 : {}
let name = a:name
if repository == {}
call vam#install#LoadPool()
let list = matchlist(a:name, 'github:\([^/]*\)\%(\/\(.*\)\)\?$')
if len(list) > 0
if '' != list[2]
let name = list[2]
let repository = { 'type': 'git', 'owner': list[1], 'repo': list[2], 'url': 'https://github.com/'.list[1].'/'.list[2] }
else
let name = list[1]
let repository = { 'type': 'git', 'owner': list[1], 'repo': 'vim-addon-'.list[1], 'url': 'https://github.com/'.list[1].'/vim-addon-'.list[1] }
endif
else
let repository = get(g:vim_addon_manager.plugin_sources, a:name, {})
if repository == {}
throw "repository ".a:name." unkown!"
else
if repository.url =~ 'github'
let owner = matchstr(repository.url, 'github.com/\zs.\+\ze/')
let repo = matchstr(repository.url, '\/\zs[^\/]\+\ze$')
let url = repository.url
let repository = { 'type': 'git', 'owner': owner, 'repo': repo, 'url': url }
endif
endif
endif
endif
let a:cache[a:name] = nix#NixDerivation(a:opts, name, repository)
" take known dependencies into account:
let deps = get(a:cache[a:name], 'dependencies', [])
call extend(a:opts.names_to_process, deps)
call extend(a:opts.names_to_export, deps)
endfun
fun! nix#TopNixOptsByParent(parents)
if (a:parents == [])
return {'ind': ' ', 'next_ind': ' ', 'sep': "\n"}
else
return {'ind': '', 'next_ind': '', 'sep': ' '}
endif
endf
fun! nix#ToNix(x, parents, opts_fun) abort
let opts = a:opts_fun == "" ? "" : call(a:opts_fun, [a:parents])
let next_parents = [a:x] + a:parents
let seps = a:0 > 1 ? a:2 : []
let ind = get(opts, 'ind', '')
let next_ind = get(opts, 'next_ind', ind.' ')
let sep = get(opts, 'sep', ind.' ')
if type(a:x) == type("")
return "''". substitute(a:x, '[$]', '$$', 'g')."''"
elseif type(a:x) == type({})
let s = ind."{".sep
for [k,v] in items(a:x)
let s .= '"'.k.'" = '.nix#ToNix(v, next_parents, a:opts_fun).";".sep
unlet k v
endfor
return s.ind."}"
" let s = ind."{\n"
" for [k,v] in items(a:x)
" let s .= next_ind . nix#ToNix(k).' = '.nix#ToNix(v, next_ind)."\n"
" unlet k v
" endfor
" return s.ind."}\n"
elseif type(a:x) == type([])
let s = ind."[".sep
for v in a:x
let s .= next_ind . nix#ToNix(v, next_parents, a:opts_fun)."".sep
unlet v
endfor
return s.ind."]"
endif
endf
" with dependencies
" opts.cache_file (caches the checkout and dependency information
" opts.path_to_nixpkgs or opts.nix_prefetch_{git,hg}
" opts.plugin_dictionaries: list of any
" - string
" - dictionary having key name or names
" This is so that plugin script files can be loaded/ merged
fun! nix#ExportPluginsForNix(opts) abort
let cache_file = get(a:opts, 'cache_file', '')
let opts = a:opts
" set nix_prefetch_* scripts
for scm in ['git', 'hg']
if !has_key(opts, 'nix_prefetch_'.scm)
let opts['nix_prefetch_'.scm] = a:opts.path_to_nixpkgs.'/pkgs/build-support/fetch'.scm.'/nix-prefetch-'.scm
endif
endfor
" create list of names from dictionaries
let a:opts.names_to_process = []
for x in a:opts.plugin_dictionaries
if type(x) == type('')
call add(opts.names_to_process, x)
elseif type(x) == type({}) && has_key(x, 'name')
call add(opts.names_to_process, x.name)
elseif type(x) == type({}) && has_key(x, 'names')
call extend(opts.names_to_process, x.names)
else
throw "unexpected"
endif
unlet x
endfor
let a:opts.names_to_export = a:opts.names_to_process
let cache = (cache_file == '' || !filereadable(cache_file)) ? {} : eval(readfile(cache_file)[0])
let failed = {}
while len(opts.names_to_process) > 0
let name = opts.names_to_process[0]
if get(opts, 'try_catch', 1)
try
call nix#AddNixDerivation(opts, cache, name)
catch /.*/
echom 'failed : '.name.' '.v:exception
let failed[name] = v:exception
endtry
else
call nix#AddNixDerivation(opts, cache, name)
endif
let opts.names_to_process = opts.names_to_process[1:]
endwhile
echom join(keys(failed), ", ")
echom string(failed)
if cache_file != ''
call writefile([string(cache)], cache_file)
endif
enew
let uniq = {}
for x in a:opts.names_to_export
let uniq[x] = 1
endfor
for k in sort(keys(uniq))
call append('$', split(cache[k].derivation,"\n"))
endfor
" for VAM users output vam.pluginDictionaries which can be fed to
" vim_customizable.customize.vimrc.vam.pluginDictionaries
call append('$', ["", "", "", '# vam.pluginDictionaries'])
let ns = []
for x in a:opts.plugin_dictionaries
if type(x) == type("")
call add(ns, nix#ToNixAttrName(x))
elseif type(x) == type({})
if has_key(x, 'name')
call add(ns, extend({'name': nix#ToNixAttrName(x.name)}, x, "keep"))
elseif has_key(x, 'names')
call add(ns, extend({'names': map(copy(x.names), 'nix#ToNixAttrName(v:val)')}, x, "keep"))
else
throw "unexpected"
endif
else
throw "unexpected"
endif
unlet x
endfor
call append('$', split(nix#ToNix(ns, [], 'nix#TopNixOptsByParent'), "\n"))
" failures:
for [k,v] in items(failed)
call append('$', ['# '.k.', failure: '.v])
unlet k v
endfor
endf

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,172 @@
{
lib,
callPackage,
tree-sitter,
neovim,
neovimUtils,
runCommand,
vimPlugins,
tree-sitter-grammars,
writableTmpDirAsHomeHook,
}:
self: super:
let
inherit (neovimUtils) grammarToPlugin;
overrides = prev: {
};
generatedGrammars =
let
generated = callPackage ./generated.nix {
inherit (tree-sitter) buildGrammar;
};
in
lib.overrideExisting generated (overrides generated);
generatedDerivations = lib.filterAttrs (_: lib.isDerivation) generatedGrammars;
# add aliases so grammars from `tree-sitter` are overwritten in `withPlugins`
# for example, for ocaml_interface, the following aliases will be added
# ocaml-interface
# tree-sitter-ocaml-interface
# tree-sitter-ocaml_interface
builtGrammars =
generatedGrammars
// lib.concatMapAttrs (
k: v:
let
replaced = lib.replaceStrings [ "_" ] [ "-" ] k;
in
{
"tree-sitter-${k}" = v;
}
// lib.optionalAttrs (k != replaced) {
${replaced} = v;
"tree-sitter-${replaced}" = v;
}
) generatedDerivations;
allGrammars = lib.attrValues generatedDerivations;
# Usage:
# pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ p.c p.java ... ])
# or for all grammars:
# pkgs.vimPlugins.nvim-treesitter.withAllGrammars
withPlugins =
f:
self.nvim-treesitter.overrideAttrs {
passthru.dependencies = map grammarToPlugin (f (tree-sitter.builtGrammars // builtGrammars));
};
withAllGrammars = withPlugins (_: allGrammars);
in
{
postPatch = ''
rm -r parser
'';
passthru = (super.nvim-treesitter.passthru or { }) // {
inherit
builtGrammars
allGrammars
grammarToPlugin
withPlugins
withAllGrammars
;
grammarPlugins = lib.mapAttrs (_: grammarToPlugin) generatedDerivations;
tests = {
check-queries =
let
nvimWithAllGrammars = neovim.override {
configure.packages.all.start = [ withAllGrammars ];
};
in
runCommand "nvim-treesitter-check-queries"
{
nativeBuildInputs = [
nvimWithAllGrammars
writableTmpDirAsHomeHook
];
CI = true;
}
''
touch $out
ln -s ${withAllGrammars}/CONTRIBUTING.md .
export ALLOWED_INSTALLATION_FAILURES=ipkg,norg,verilog
nvim --headless "+luafile ${withAllGrammars}/scripts/check-queries.lua" | tee log
if grep -q Warning log; then
echo "WARNING: warnings were emitted by the check"
echo "Check if they were expected warnings!"
fi
'';
tree-sitter-queries-are-present-for-custom-grammars =
let
pluginsToCheck =
map (grammar: grammarToPlugin grammar)
# true is here because there is `recurseForDerivations = true`
(lib.remove true (lib.attrValues tree-sitter-grammars));
in
runCommand "nvim-treesitter-test-queries-are-present-for-custom-grammars" { CI = true; } ''
function check_grammar {
EXPECTED_FILES="$2/parser/$1.so `ls $2/queries/$1/*.scm`"
echo
echo expected files for $1:
echo $EXPECTED_FILES
# the derivation has only symlinks, and `find` doesn't count them as files
# so we cannot use `-type f`
for file in `find $2 -not -type d`; do
echo checking $file
# see https://stackoverflow.com/a/8063284
if ! echo "$EXPECTED_FILES" | grep -wqF "$file"; then
echo $file is unexpected, exiting
exit 1
fi
done
}
${lib.concatLines (lib.forEach pluginsToCheck (g: "check_grammar \"${g.grammarName}\" \"${g}\""))}
touch $out
'';
no-queries-for-official-grammars =
let
pluginsToCheck =
# true is here because there is `recurseForDerivations = true`
(lib.remove true (lib.attrValues vimPlugins.nvim-treesitter-parsers));
in
runCommand "nvim-treesitter-test-no-queries-for-official-grammars" { CI = true; } ''
touch $out
function check_grammar {
echo checking $1...
if [ -d $2/queries ]; then
echo Queries dir exists in $1
echo This is unexpected, see https://github.com/NixOS/nixpkgs/pull/344849#issuecomment-2381447839
exit 1
fi
}
${lib.concatLines (lib.forEach pluginsToCheck (g: "check_grammar \"${g.grammarName}\" \"${g}\""))}
'';
};
};
meta =
with lib;
(super.nvim-treesitter.meta or { })
// {
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
};
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
diff --git a/lua/aider.lua b/lua/aider.lua
index 98b5071..589b06d 100644
--- a/lua/aider.lua
+++ b/lua/aider.lua
@@ -61,9 +61,9 @@ function M.AiderOpen(args, window_type)
log("Existing aider buffer found, opening in new window")
helpers.open_buffer_in_new_window(window_type, M.aider_buf)
else
log("No existing aider buffer, creating new one")
- local command = "aider " .. (args or "")
+ local command = "@aider@ " .. (args or "")
log("Opening window with type: " .. window_type)
helpers.open_window(window_type)
log("Adding buffers to command")
command = helpers.add_buffers_to_command(command, is_valid_buffer)

View File

@@ -0,0 +1,13 @@
diff --git a/plugin/activitywatch.vim b/plugin/activitywatch.vim
index 6986553..7462b02 100644
--- a/plugin/activitywatch.vim
+++ b/plugin/activitywatch.vim
@@ -29,7 +29,7 @@ let s:heartbeat_apiurl = printf('%s/heartbeat?pulsetime=30', s:bucket_apiurl)
let s:http_response_code = {}
function! HTTPPostJson(url, data)
- let l:req = ['curl', '-s', a:url,
+ let l:req = ['@curl@', '-s', a:url,
\ '-H', 'Content-Type: application/json',
\ '-X', 'POST',
\ '-d', json_encode(a:data),

View File

@@ -0,0 +1,31 @@
diff --git a/chadtree/__main__.py b/chadtree/__main__.py
index 83341fc..af8c9b0 100644
if command == "deps":
@@ -129,7 +129,7 @@ elif command == "run":
try:
if not _IN_VENV:
raise ImportError()
- elif lock != _REQ:
+ elif False:
raise ImportError()
else:
import pynvim_pp
diff --git a/chadtree/consts.py b/chadtree/consts.py
index e2d3aa0..e77a129 100644
--- a/chadtree/consts.py
+++ b/chadtree/consts.py
@@ -1,4 +1,5 @@
from os import environ, name
+from pathlib import Path
from chad_types import TOP_LEVEL
@@ -24,7 +25,7 @@ SETTINGS_VAR = "chadtree_settings"
STORAGE
"""
-_VARS = TOP_LEVEL / ".vars"
+_VARS = Path.home() / ".cache/chadtree/vars"
RT_DIR = _VARS / "runtime"
RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3"
SESSION_DIR = _VARS / "sessions"

View File

@@ -0,0 +1,35 @@
diff --git a/coq/__main__.py b/coq/__main__.py
index f588f718..36bcca21 100644
--- a/coq/__main__.py
+++ b/coq/__main__.py
@@ -78,7 +78,7 @@ _EXEC_PATH = Path(executable)
_EXEC_PATH = _EXEC_PATH.parent.resolve(strict=True) / _EXEC_PATH.name
_REQ = REQUIREMENTS.read_text()
-_IN_VENV = _RT_PY.parent.resolve() / _RT_PY.name == _EXEC_PATH
+_IN_VENV = True
if command == "deps":
@@ -152,7 +152,7 @@ elif command == "run":
try:
if not _IN_VENV:
raise ImportError()
- elif lock != _REQ:
+ elif False:
raise ImportError()
else:
import pynvim_pp
diff --git a/coq/consts.py b/coq/consts.py
index 804e92ab..5c090a93 100644
--- a/coq/consts.py
+++ b/coq/consts.py
@@ -10,7 +10,7 @@ TOP_LEVEL = Path(__file__).resolve(strict=True).parent.parent
REQUIREMENTS = TOP_LEVEL / "requirements.txt"
-VARS = TOP_LEVEL / ".vars"
+VARS = Path.home() / ".cache/coq_nvim/vars"
RT_DIR = VARS / "runtime"
RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3"

View File

@@ -0,0 +1,31 @@
From f8e993846551bda77a34a77aad7ad6dcc45b66a7 Mon Sep 17 00:00:00 2001
From: Philipp Joram <nixpgks@phijor.me>
Date: Tue, 16 Apr 2024 12:48:42 +0300
Subject: [PATCH] Unconditionally use global binary
---
ftplugin/agda.vim | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/ftplugin/agda.vim b/ftplugin/agda.vim
index c7dd9d0..6b4aba3 100644
--- a/ftplugin/agda.vim
+++ b/ftplugin/agda.vim
@@ -11,13 +11,7 @@ if exists("b:cornelis_ftplugin")
endif
let b:cornelis_ftplugin = 1
-if exists("g:cornelis_use_global_binary")
- call remote#host#Register('cornelis', '*', rpcstart('cornelis', []))
-else
- call nvimhs#start(expand('<sfile>:p:h:h'), 'cornelis', ['-v', 'DEBUG', '-l', '/tmp/cornelis.log'])
-endif
-
-nnoremap <F5> :call nvimhs#compileAndRestart('cornelis')<CR>
+call remote#host#Register('cornelis', '*', rpcstart('@CORNELIS@', []))
runtime agda-input.vim
runtime agda-matchpairs.vim
--
2.44.0

View File

@@ -0,0 +1,25 @@
diff --git a/rplugin/python3/fruzzy_mod.nim b/rplugin/python3/fruzzy_mod.nim
index dba0689..0109285 100644
--- a/rplugin/python3/fruzzy_mod.nim
+++ b/rplugin/python3/fruzzy_mod.nim
@@ -12,9 +12,7 @@ when defined(profile):
import nimprof
proc getVersion(): string {.compileTime.}=
- let ver = staticExec("git describe --tags --always --dirty").strip()
- # let cTime = format(times.now(), "yyyy-MM-dd hh:mm:ss")
- let branch = staticExec("git rev-parse --abbrev-ref HEAD").strip()
+ let ver = "@version@"
var options:seq[string] = newSeq[string]()
if not defined(removelogger):
options.add("info")
@@ -26,7 +24,7 @@ proc getVersion(): string {.compileTime.}=
options.add("release")
let optionsStr = options.join(",")
- return &"rev: {ver} on branch: {branch} with options: {optionsStr}"
+ return &"version: {ver} with options: {optionsStr}"
let L = newConsoleLogger(levelThreshold = logging.Level.lvlDebug)
addHandler(L)

View File

@@ -0,0 +1,13 @@
diff --git a/lua/gx/init.lua b/lua/gx/init.lua
index 12272d4..c51771a 100644
--- a/lua/gx/init.lua
+++ b/lua/gx/init.lua
@@ -73,7 +73,7 @@ local function get_open_browser_app()
if sysname == "Darwin" then
app = "open"
elseif sysname == "Linux" then
- app = "xdg-open"
+ app = "@xdg-utils@/bin/xdg-open"
elseif sysname == "Windows_NT" then
app = "powershell.exe"
end

View File

@@ -0,0 +1,14 @@
diff --git a/lua/lazy/help.lua b/lua/lazy/help.lua
index 4a289eb..5ddc168 100644
--- a/lua/lazy/help.lua
+++ b/lua/lazy/help.lua
@@ -38,9 +38,6 @@ function M.index(plugin)
end
function M.update()
- if Config.plugins["lazy.nvim"] then
- vim.cmd.helptags(Config.plugins["lazy.nvim"].dir .. "/doc")
- end
if Config.options.readme.enabled == false then
return
end

View File

@@ -0,0 +1,12 @@
diff --git a/doc/lens.txt b/doc/lens.txt
index 60943ce..2fe43dc 100644
--- a/doc/lens.txt
+++ b/doc/lens.txt
@@ -76,7 +76,6 @@ g:lens#disabled_filenames
Default value is [].
*g:lens#animate*
- *g:lens#animate*
g:lens#animate
If value is 1 and animate.vim is installed, the window resize
will be animated.

View File

@@ -0,0 +1,31 @@
diff --git a/autoload/health/mkdp.vim b/autoload/health/mkdp.vim
index 323b57b..8053ea8 100644
--- a/autoload/health/mkdp.vim
+++ b/autoload/health/mkdp.vim
@@ -8,8 +8,8 @@ function! health#mkdp#check() abort
lua vim.health.info('Pre build: ' .. vim.api.nvim_eval('l:mkdp_server_script'))
lua vim.health.info('Pre build version: ' .. vim.fn['mkdp#util#pre_build_version']())
lua vim.health.ok('Using pre build')
- elseif executable('node')
- lua vim.health.info('Node version: ' .. string.gsub(vim.fn.system('node --version'), '^%s*(.-)%s*$', '%1'))
+ else
+ lua vim.health.info('Node version: ' .. string.gsub(vim.fn.system('@node@ --version'), '^%s*(.-)%s*$', '%1'))
let l:mkdp_server_script = s:mkdp_root_dir .. '/app/server.js'
lua vim.health.info('Script: ' .. vim.api.nvim_eval('l:mkdp_server_script'))
lua vim.health.info('Script exists: ' .. vim.fn.filereadable(vim.api.nvim_eval('l:mkdp_server_script')))
diff --git a/autoload/mkdp/rpc.vim b/autoload/mkdp/rpc.vim
index b257571..57f04e7 100644
--- a/autoload/mkdp/rpc.vim
+++ b/autoload/mkdp/rpc.vim
@@ -41,9 +41,9 @@ function! mkdp#rpc#start_server() abort
let l:mkdp_server_script = s:mkdp_root_dir . '/app/bin/markdown-preview-' . mkdp#util#get_platform()
if executable(l:mkdp_server_script)
let l:cmd = [l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
- elseif executable('node')
+ else
let l:mkdp_server_script = s:mkdp_root_dir . '/app/index.js'
- let l:cmd = ['node', l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
+ let l:cmd = ['@node@', l:mkdp_server_script, '--path', s:mkdp_root_dir . '/app/server.js']
endif
if exists('l:cmd')
if s:is_vim

View File

@@ -0,0 +1,48 @@
{
"name": "markdown-preview",
"version": "0.0.10",
"description": "markdown preview plugin for (neo)vim",
"bin": "./app/server.js",
"repository": "https://github.com/iamcco/markdown-preview.nvim.git",
"author": "年糕小豆汤 <ooiss@qq.com>",
"license": "MIT",
"private": true,
"scripts": {
"watch": "tsc -w -p ./",
"build-app": "cd app && rm -rf ./.next && next build && next export",
"build-lib": "tsc -p ./",
"build": "tsc -p ./ && cd app && rm -rf ./.next && next build && next export && yarn && pkg --targets node16-linux-x64,node16-macos-x64,node16-win-x64 --out-path ./bin . && rm -rf ./node_modules ./.next"
},
"dependencies": {
"@chemzqm/neovim": "^5.7.9",
"chart.js": "^2.7.3",
"highlight.js": "^10.4.1",
"log4js": "^6.4.0",
"markdown-it": "^12.3.2",
"markdown-it-anchor": "^5.2.4",
"markdown-it-deflist": "^2.0.3",
"markdown-it-emoji": "^1.4.0",
"markdown-it-footnote": "^3.0.1",
"markdown-it-task-lists": "^2.1.1",
"markdown-it-toc-done-right": "^4.0.1",
"md-it-meta": "^0.0.2",
"msgpack-lite": "^0.1.26",
"next": "^7.0.2",
"next-routes": "^1.4.2",
"plantuml-encoder": "^1.4.0",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1"
},
"devDependencies": {
"@types/node": "16",
"pkg": "^5.6.0",
"prettier": "^2.6.2",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^4.6.4",
"yuuko-tsconfig": "^1.0.0"
}
}

View File

@@ -0,0 +1,26 @@
diff --git a/autoload/health/openscad_nvim.vim b/autoload/health/openscad_nvim.vim
index d6d4b4c..9853877 100644
--- a/autoload/health/openscad_nvim.vim
+++ b/autoload/health/openscad_nvim.vim
@@ -15,7 +15,7 @@ function! s:check_zathura_installed() abort
endfunction
function! s:check_htop_installed() abort
- if !executable('htop')
+ if !executable('@htop@')
call v:lua.vim.health.error('has(htop)','install htop')
else
call v:lua.vim.health.ok("htop is installed")
diff --git a/lua/openscad.lua b/lua/openscad.lua
index 0a26d08..1264989 100644
--- a/lua/openscad.lua
+++ b/lua/openscad.lua
@@ -126,7 +126,7 @@ function M.exec_openscad()
jobCommand = '/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD ' .. filename
else
-- TODO: What about Windows?
- jobCommand = 'openscad ' .. filename
+ jobCommand = '@openscad@ ' .. filename
end
vim.fn.jobstart(jobCommand)

View File

@@ -0,0 +1,37 @@
diff --git a/app/src/main.ts b/app/src/main.ts
index c82d914..e8542f3 100644
--- a/app/src/main.ts
+++ b/app/src/main.ts
@@ -73,7 +73,7 @@ async function init(socket: WebSocket) {
const onListen: Deno.ServeOptions['onListen'] = ({ hostname, port }) => {
const serverUrl = `${hostname.replace('0.0.0.0', 'localhost')}:${port}`;
logger.info(`listening on ${serverUrl}`);
- const webview = new Deno.Command('deno', {
+ const webview = new Deno.Command('@deno@', {
cwd: dirname(fromFileUrl(Deno.mainModule)),
args: [
'run',
diff --git a/lua/peek/app.lua b/lua/peek/app.lua
index af5148e..5e67563 100644
--- a/lua/peek/app.lua
+++ b/lua/peek/app.lua
@@ -38,10 +38,17 @@ function module.setup()
end
cmd = vim.list_extend({
- 'deno',
- 'task',
- '--quiet',
+ '@deno@',
'run',
+ '--allow-read',
+ '--allow-write',
+ '--allow-net',
+ '--allow-env',
+ '--allow-run',
+ '--no-check',
+ '--allow-import',
+ '--no-lock',
+ '../../app/src/main.ts',
}, args)
end

View File

@@ -0,0 +1,22 @@
diff --git a/lua/preview.lua b/lua/preview.lua
index 6d9875d..729cc70 100644
--- a/lua/preview.lua
+++ b/lua/preview.lua
@@ -28,7 +28,7 @@ local function open_window(file)
vim.env.MDT_WIDTH = width
vim.cmd.vnew()
- vim.fn.termopen("mdt " .. file)
+ vim.fn.termopen("@mdt@ " .. file)
vim.cmd("setlocal nonumber norelativenumber")
vim.api.nvim_feedkeys("a", "t", false)
@@ -49,7 +49,7 @@ end
function M.setup()
-- Check if "mdt" is installed
if vim.fn.executable("mdt") == 0 then
- install()
+ -- install()
end
set_cmd()

View File

@@ -0,0 +1,31 @@
diff --git a/lua/ranger-nvim.lua b/lua/ranger-nvim.lua
index be95e36..3bd1587 100644
--- a/lua/ranger-nvim.lua
+++ b/lua/ranger-nvim.lua
@@ -127,7 +127,7 @@ local function build_ranger_cmd(select_current_file)
local selectfile_flag = select_current_file and " --selectfile=" .. selected_file or ""
if select_current_file then
return string.format(
- "ranger --choosefiles=%s %s %s",
+ "@ranger@ --choosefiles=%s %s %s",
SELECTED_FILEPATH,
selectfile_flag,
create_ranger_cmd_flags(create_cmd_values(opts.keybinds))
@@ -135,7 +135,7 @@ local function build_ranger_cmd(select_current_file)
else
vim.api.nvim_buf_delete(1, { force = true })
return string.format(
- "ranger --choosefiles=%s %s %s",
+ "@ranger@ --choosefiles=%s %s %s",
SELECTED_FILEPATH,
create_ranger_cmd_flags(create_cmd_values(opts.keybinds)),
get_absolute_argument()
@@ -209,7 +209,7 @@ end
---Opens ranger and open selected files on exit.
---@param select_current_file boolean|nil open ranger and select the current file. Defaults to true.
function M.open(select_current_file)
- if vim.fn.executable("ranger") ~= 1 then
+ if vim.fn.executable("@ranger@") ~= 1 then
vim.api.nvim_err_write(
"ranger executable not found, please check that ranger is installed and is in your path\n"
)

View File

@@ -0,0 +1,13 @@
diff --git a/lua/tsc/utils.lua b/lua/tsc/utils.lua
index 6433bcb..75760f9 100644
--- a/lua/tsc/utils.lua
+++ b/lua/tsc/utils.lua
@@ -16,7 +16,7 @@ M.find_tsc_bin = function()
return node_modules_tsc_binary
end
- return "tsc"
+ return "@tsc@"
end
--- @param run_mono_repo boolean

View File

@@ -0,0 +1,11 @@
--- vim-grammarous-51ef519.org/autoload/grammarous.vim 1970-01-01 01:00:01.000000000 +0100
+++ vim-grammarous-51ef519/autoload/grammarous.vim 2017-11-21 16:33:27.473403322 +0000
@@ -22,7 +22,7 @@
let g:grammarous#enable_spell_check = get(g:, 'grammarous#enable_spell_check', 0)
let g:grammarous#move_to_first_error = get(g:, 'grammarous#move_to_first_error', 1)
let g:grammarous#hooks = get(g:, 'grammarous#hooks', {})
-let g:grammarous#languagetool_cmd = get(g:, 'grammarous#languagetool_cmd', '')
+let g:grammarous#languagetool_cmd = get(g:, 'grammarous#languagetool_cmd', '@languagetool@/bin/languagetool-commandline')
let g:grammarous#show_first_error = get(g:, 'grammarous#show_first_error', 0)
highlight default link GrammarousError SpellBad

View File

@@ -0,0 +1,13 @@
diff --git a/plugin/sensible.vim b/plugin/sensible.vim
index c9387ae..a226760 100644
--- a/plugin/sensible.vim
+++ b/plugin/sensible.vim
@@ -26,7 +26,7 @@ function! s:MaySet(option) abort
silent verbose execute 'setglobal all' a:option . '?'
redir END
endif
- return out !~# " \\(\\~[\\/]\\|Lua\\)[^\n]*$"
+ return out !~# "/nix/store/.*" && out !~# " \\(\\~[\\/][^\n]*\\|Lua\\)$"
endfunction
if s:MaySet('backspace')

View File

@@ -0,0 +1 @@
Instructions for adding Vim plugins to `nixpkgs` can be found [here](/doc/languages-frameworks/vim.section.md).

View File

@@ -0,0 +1,60 @@
{
lib,
stdenv,
rtpPath,
toVimPlugin,
}:
{
addRtp = drv: lib.warn "`addRtp` is deprecated, does nothing." drv;
buildVimPlugin =
{
name ? "${attrs.pname}-${attrs.version}",
src,
unpackPhase ? "",
configurePhase ? ":",
buildPhase ? ":",
preInstall ? "",
postInstall ? "",
path ? ".",
addonInfo ? null,
meta ? { },
...
}@attrs:
let
drv = stdenv.mkDerivation (
attrs
// {
name = lib.warnIf (attrs ? vimprefix) "The 'vimprefix' is now hardcoded in toVimPlugin" name;
__structuredAttrs = true;
inherit
unpackPhase
configurePhase
buildPhase
addonInfo
preInstall
postInstall
;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
runHook postInstall
'';
meta = {
platforms = lib.platforms.all;
}
// meta;
}
);
in
toVimPlugin drv;
}

View File

@@ -0,0 +1,33 @@
with import <localpkgs> { };
let
inherit (vimUtils.override { inherit vim; }) buildVimPlugin;
inherit (neovimUtils) buildNeovimPlugin;
generated = callPackage <localpkgs/pkgs/applications/editors/vim/plugins/generated.nix> {
inherit buildNeovimPlugin buildVimPlugin;
} { } { };
hasChecksum =
value:
lib.isAttrs value
&& lib.hasAttrByPath [
"src"
"outputHash"
] value;
parse = name: value: {
pname = value.pname;
version = value.version;
homePage = value.meta.homepage;
checksum =
if hasChecksum value then
{
submodules = value.src.fetchSubmodules or false;
sha256 = value.src.outputHash;
rev = value.src.rev;
}
else
null;
};
in
lib.mapAttrs parse generated

View File

@@ -0,0 +1,20 @@
{
pkgs ? import ../../../../../../.. { },
}:
with pkgs;
let
pythonWithPackages = python3.withPackages (
ps: with ps; [
requests
]
);
in
mkShell {
packages = [
nurl
pythonWithPackages
];
}

View File

@@ -0,0 +1,126 @@
#!/usr/bin/env nix-shell
#!nix-shell ./update-shell.nix -i python
import json
import logging
import os
import subprocess
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
import requests
log = logging.getLogger("vim-updater")
NURR_JSON_URL = (
"https://raw.githubusercontent.com/nvim-neorocks/nurr/main/tree-sitter-parsers.json"
)
def generate_grammar(lang, parser_info):
"""Generate grammar for a language based on the parser info"""
if "install_info" not in parser_info:
log.warning(f"Parser {lang} does not have install_info, skipping")
return ""
install_info = parser_info["install_info"]
url = install_info["url"]
rev = install_info["revision"]
generated = f""" {lang} = buildGrammar {{
language = "{lang}";
version = "0.0.0+rev={rev[:7]}";
src = """
generated += subprocess.check_output(
["nurl", url, rev, "--indent=4"], text=True
)
generated += ";"
location = install_info.get("location", "")
if location:
generated += f"""
location = "{location}";"""
if install_info.get("generate", False):
generated += """
generate = true;"""
generated += f"""
meta.homepage = "{url}";
}};
"""
return generated
def fetch_nurr_parsers():
"""Fetch the parser information from nurr repository"""
log.info("Fetching parser data from %s", NURR_JSON_URL)
headers = {}
github_token = os.environ.get("GITHUB_TOKEN")
if github_token:
log.info("Using GITHUB_TOKEN for authentication")
headers["Authorization"] = f"token {github_token}"
else:
log.warning("No GITHUB_TOKEN found. GitHub API requests may be rate-limited.")
response = requests.get(NURR_JSON_URL, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
try:
parsers = data["parsers"]
except KeyError:
raise ValueError(
"Unexpected response from NURR:\n" + json.dumps(data, indent=2)
)
log.info(f"Successfully fetched {len(parsers)} parsers")
return parsers
def process_parser_info(parser_info):
"""Process a single parser info entry and generate grammar for it"""
return generate_grammar(parser_info["lang"], parser_info)
def update_grammars():
"""Update grammar definitions using nurr's parser information"""
parsers_info = fetch_nurr_parsers()
generated_file = """# generated by pkgs/applications/editors/vim/plugins/utils/nvim-treesitter/update.py
# Using parser data from https://github.com/nvim-neorocks/nurr/blob/main/tree-sitter-parsers.json
{
buildGrammar,
"""
nurl_output = subprocess.check_output(["nurl", "-Ls", ","], text=True).strip()
indented_output = nurl_output.replace(",", ",\n ")
generated_file += indented_output
generated_file += """,
}:
{
"""
# Process parsers in parallel for better performance
with ThreadPoolExecutor(max_workers=5) as executor:
for generated in executor.map(process_parser_info, parsers_info):
generated_file += generated
generated_file += "}\n"
return generated_file
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
generated = update_grammars()
output_path = Path(__file__).parent.parent.parent / "nvim-treesitter/generated.nix"
log.info("Writing output to %s", output_path)
with open(output_path, "w") as f:
f.write(generated)
log.info("Successfully updated grammar definitions")

View File

@@ -0,0 +1,170 @@
#!/usr/bin/env python
# run with:
# $ nix run .\#vimPluginsUpdater
# format:
# $ nix run nixpkgs#python3Packages.ruff -- update.py
# type-check:
# $ nix run nixpkgs#python3Packages.mypy -- update.py
# linted:
# $ nix run nixpkgs#python3Packages.flake8 -- --ignore E501,E265,E402 update.py
# If you see `HTTP Error 429: too many requests` errors while running this
# script, refer to:
#
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md#updating-plugins-in-nixpkgs-updating-plugins-in-nixpkgs
#
# (or the equivalent file /doc/languages-frameworks/vim.section.md
# from Nixpkgs master tree).
#
import inspect
import logging
import os
import textwrap
from pathlib import Path
from typing import List, Tuple
log = logging.getLogger("vim-updater")
# Import plugin update library from maintainers/scripts/pluginupdate.py
ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
import importlib
import pluginupdate
from pluginupdate import PluginDesc, run_nix_expr
treesitter = importlib.import_module("nvim-treesitter.update")
HEADER = (
"# GENERATED by ./pkgs/applications/editors/vim/plugins/utils/update.py. Do not edit!"
)
NIXPKGS_NVIMTREESITTER_FOLDER = "pkgs/applications/editors/vim/plugins/nvim-treesitter"
class VimEditor(pluginupdate.Editor):
nvim_treesitter_updated = False
def generate_nix(
self, plugins: List[Tuple[PluginDesc, pluginupdate.Plugin]], outfile: str
):
log.info("Generating nix code")
log.debug("Loading nvim-treesitter revision from nix...")
nvim_treesitter_rev = pluginupdate.run_nix_expr(
"(import <localpkgs> { }).vimPlugins.nvim-treesitter.src.rev",
self.nixpkgs,
timeout=10,
)
GET_PLUGINS_LUA = """
with import <localpkgs> {};
lib.attrNames lua51Packages"""
log.debug("Loading list of lua plugins...")
luaPlugins = run_nix_expr(GET_PLUGINS_LUA, self.nixpkgs, timeout=30)
def _isNeovimPlugin(plug: pluginupdate.Plugin) -> bool:
"""
Whether it's a neovim-only plugin
We can check if it's available in lua packages
"""
if plug.normalized_name in luaPlugins:
log.debug("%s is a neovim plugin", plug)
return True
return False
with open(outfile, "w+") as f:
log.debug("Writing to %s", outfile)
f.write(HEADER)
f.write(
textwrap.dedent(
"""
{
lib,
buildVimPlugin,
buildNeovimPlugin,
fetchFromGitHub,
}:
final: prev: {
"""
)
)
for pdesc, plugin in plugins:
content = self.plugin2nix(pdesc, plugin, _isNeovimPlugin(plugin))
f.write(content)
if (
plugin.name == "nvim-treesitter"
and plugin.commit != nvim_treesitter_rev
):
self.nvim_treesitter_updated = True
f.write("}\n")
print(f"updated {outfile}")
def plugin2nix(
self, pdesc: PluginDesc, plugin: pluginupdate.Plugin, isNeovim: bool
) -> str:
if isNeovim:
raise RuntimeError(f"Plugin {plugin.name} is already packaged in `luaPackages`, please use that")
repo = pdesc.repo
content = f" {plugin.normalized_name} = "
src_nix = repo.as_nix(plugin)
content += """{buildFn} {{
pname = "{plugin.name}";
version = "{plugin.version}";
src = {src_nix};
meta.homepage = "{repo.uri}";
meta.hydraPlatforms = [ ];
}};
""".format(
buildFn="buildNeovimPlugin" if isNeovim else "buildVimPlugin",
plugin=plugin,
src_nix=src_nix,
repo=repo,
)
log.debug(content)
return content
def update(self, args):
pluginupdate.update_plugins(self, args)
# TODO this should probably be skipped when running outside a nixpkgs checkout
if self.nvim_treesitter_updated:
print("updating nvim-treesitter grammars")
generated = treesitter.update_grammars()
treesitter_generated_nix_path = os.path.join(
NIXPKGS_NVIMTREESITTER_FOLDER, "generated.nix"
)
open(os.path.join(args.nixpkgs, treesitter_generated_nix_path), "w").write(
generated
)
if self.nixpkgs_repo:
index = self.nixpkgs_repo.index
for diff in index.diff(None):
if diff.a_path == treesitter_generated_nix_path:
msg = "vimPlugins.nvim-treesitter: update grammars"
print(f"committing to nixpkgs: {msg}")
index.add([treesitter_generated_nix_path])
index.commit(msg)
return
print("no updates to nvim-treesitter grammars")
def main():
global luaPlugins
log.debug(f"Loading from {ROOT}/get-plugins.nix")
with open(f"{ROOT}/get-plugins.nix") as f:
GET_PLUGINS = f.read()
editor = VimEditor(
"vim", Path("pkgs/applications/editors/vim/plugins"), GET_PLUGINS
)
editor.run()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,60 @@
{
lib,
buildPythonApplication,
makeWrapper,
nix,
nix-prefetch-git,
nurl,
python3Packages,
vimPluginsUpdater,
writeShellScript,
# optional
neovim-unwrapped,
}:
buildPythonApplication {
pname = "vim-plugins-updater";
version = "0.1";
format = "other";
nativeBuildInputs = [
makeWrapper
python3Packages.wrapPython
];
pythonPath = [
python3Packages.gitpython
python3Packages.requests
];
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin $out/lib
cp ${./update.py} $out/bin/vim-plugins-updater
cp ${./get-plugins.nix} $out/bin/get-plugins.nix
# wrap python scripts
makeWrapperArgs+=( --prefix PATH : "${
lib.makeBinPath [
nix
nix-prefetch-git
neovim-unwrapped
nurl
]
}" --prefix PYTHONPATH : "${./.}:${../../../../../../maintainers/scripts/pluginupdate-py}" )
wrapPythonPrograms
'';
shellHook = ''
export PYTHONPATH=pkgs/applications/editors/vim/plugins:maintainers/scripts/pluginupdate-py:$PYTHONPATH
'';
passthru.updateScript = writeShellScript "updateScript" ''
# don't saturate the update bot connection
${lib.getExe vimPluginsUpdater} --proc 2 update
'';
meta.mainProgram = "vim-plugins-updater";
}

View File

@@ -0,0 +1,520 @@
# tests available at pkgs/test/vim
{
lib,
stdenv,
vim,
vimPlugins,
buildEnv,
writeText,
runCommand,
makeWrapper,
python3,
callPackage,
makeSetupHook,
linkFarm,
config,
}:
/*
USAGE EXAMPLE
=============
Install Vim like this eg using nixos option environment.systemPackages which will provide
vim-with-plugins in PATH:
vim-full.customize {
name = "vim-with-plugins"; # optional
# add custom .vimrc lines like this:
vimrcConfig.customRC = ''
set hidden
'';
# store your plugins in Vim packages
vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; {
# loaded on launch
start = [ youcompleteme fugitive ];
# manually loadable by calling `:packadd $plugin-name`
opt = [ phpCompletion elm-vim ];
# To automatically load a plugin when opening a filetype, add vimrc lines like:
# autocmd FileType php :packadd phpCompletion
};
};
WHAT IS A VIM PLUGIN?
=====================
Typical plugin files:
plugin/P1.vim
autoload/P1.vim
ftplugin/xyz.vim
doc/plugin-documentation.txt (traditional documentation)
README(.md) (nowadays thanks to github)
Vim offers the :h rtp setting which works for most plugins. Thus adding
this to your .vimrc should make most plugins work:
set rtp+=~/.nix-profile/share/vim-plugins/youcompleteme
" or for p in ["youcompleteme"] | exec 'set rtp+=~/.nix-profile/share/vim-plugins/'.p | endfor
Learn about about plugin Vim plugin mm managers at
http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html.
The documentation can be accessed by Vim's :help command if it was tagged.
See vimHelpTags sample code below.
CONTRIBUTING AND CUSTOMIZING
============================
The example file pkgs/applications/editors/vim/plugins/default.nix provides
both:
* manually maintained plugins
* plugins created by VAM's nix#ExportPluginsForNix implementation
I highly recommend to lookup vim plugin attribute names at the [vim-pi] project
which is a database containing all plugins from
vim.org and quite a lot of found at github and similar sources. vim-pi's documented purpose
is to associate vim.org script ids to human readable names so that dependencies
can be describe easily.
How to find a name?
* http://vam.mawercer.de/ or VAM's
* grep vim-pi
* use VAM's completion or :AddonsInfo command
It might happen than a plugin is not known by vim-pi yet. We encourage you to
contribute to vim-pi so that plugins can be updated automatically.
CREATING DERIVATIONS AUTOMATICALLY BY PLUGIN NAME
==================================================
Most convenient is to use a ~/.vim-scripts file putting a plugin name into each line
as documented by [VAM]'s README.md
It is the same format you pass to vimrcConfig.vam.pluginDictionaries from the
usage example above.
Then create a temp vim file and insert:
let opts = {}
let opts.path_to_nixpkgs = '/etc/nixos/nixpkgs'
let opts.cache_file = '/tmp/export-vim-plugin-for-nix-cache-file'
let opts.plugin_dictionaries = map(readfile("vim-plugins"), 'eval(v:val)')
" add more files
" let opts.plugin_dictionaries += map(.. other file )
call nix#ExportPluginsForNix(opts)
Then ":source %" it.
nix#ExportPluginsForNix is provided by ./vim2nix
A buffer will open containing the plugin derivation lines as well list
fitting the vimrcConfig.vam.pluginDictionaries option.
Thus the most simple usage would be:
vim_with_plugins =
let vim = vim-full;
inherit (vimUtil.override {inherit vim}) rtpPath addRtp buildVimPlugin vimHelpTags;
vimPlugins = [
# the derivation list from the buffer created by nix#ExportPluginsForNix
# don't set which will default to pkgs.vimPlugins
];
in vim.customize {
name = "vim-with-plugins";
vimrcConfig.customRC = '' .. '';
vimrcConfig.vam.knownPlugins = vimPlugins;
vimrcConfig.vam.pluginDictionaries = [
# the plugin list form ~/.vim-scripts turned into nix format added to
# the buffer created by the nix#ExportPluginsForNix
];
}
vim_with_plugins can be installed like any other application within Nix.
[VAM] https://github.com/MarcWeber/vim-addon-manager
[vim-pi] https://bitbucket.org/vimcommunity/vim-pi
*/
let
inherit lib;
# make sure a plugin is a derivation and its dependencies are derivations. If
# plugin already is a derivation, this is a no-op. If it is a string, it is
# looked up in knownPlugins.
pluginToDrv =
knownPlugins: plugin:
let
drv =
if builtins.isString plugin then
# make sure `pname` is set to that we are able to convert the derivation
# back to a string.
(knownPlugins.${plugin} // { pname = plugin; })
else
plugin;
in
# make sure all the dependencies of the plugin are also derivations
drv // { dependencies = map (pluginToDrv knownPlugins) (drv.dependencies or [ ]); };
# transitive closure of plugin dependencies (plugin needs to be a derivation)
transitiveClosure =
plugin:
[ plugin ]
++ (lib.unique (builtins.concatLists (map transitiveClosure plugin.dependencies or [ ])));
findDependenciesRecursively = plugins: lib.concatMap transitiveClosure plugins;
vamDictToNames =
x: if builtins.isString x then [ x ] else (lib.optional (x ? name) x.name) ++ (x.names or [ ]);
rtpPath = ".";
vimFarm =
prefix: name: drvs:
let
mkEntryFromDrv = drv: {
name = "${prefix}/${lib.getName drv}";
path = drv;
};
in
linkFarm name (map mkEntryFromDrv drvs);
/*
Generates a packpath folder as expected by vim
Example:
packDir (myVimPackage.{ start = [ vimPlugins.vim-fugitive ]; opt = [] })
=> "/nix/store/xxxxx-pack-dir"
*/
packDir =
packages:
let
packageLinks =
packageName:
{
start ? [ ],
opt ? [ ],
}:
let
# `nativeImpl` expects packages to be derivations, not strings (as
# opposed to older implementations that have to maintain backwards
# compatibility). Therefore we don't need to deal with "knownPlugins"
# and can simply pass `null`.
depsOfOptionalPlugins = lib.subtractLists opt (findDependenciesRecursively opt);
startWithDeps = findDependenciesRecursively start;
allPlugins = lib.unique (startWithDeps ++ depsOfOptionalPlugins);
allPython3Dependencies =
ps: lib.flatten (map (plugin: (plugin.python3Dependencies or (_: [ ])) ps) allPlugins);
python3Env = python3.withPackages allPython3Dependencies;
packdirStart = vimFarm "pack/${packageName}/start" "packdir-start" allPlugins;
packdirOpt = vimFarm "pack/${packageName}/opt" "packdir-opt" opt;
# Assemble all python3 dependencies into a single `site-packages` to avoid doing recursive dependency collection
# for each plugin.
# This directory is only for python import search path, and will not slow down the startup time.
# see :help python3-directory for more details
python3link = runCommand "vim-python3-deps" { } ''
mkdir -p $out/pack/${packageName}/start/__python3_dependencies
ln -s ${python3Env}/${python3Env.sitePackages} $out/pack/${packageName}/start/__python3_dependencies/python3
'';
in
[
packdirStart
packdirOpt
]
++ lib.optional (allPython3Dependencies python3.pkgs != [ ]) python3link;
in
buildEnv {
name = "vim-pack-dir";
paths = (lib.flatten (lib.mapAttrsToList packageLinks packages));
};
nativeImpl = packages: ''
set packpath^=${packDir packages}
set runtimepath^=${packDir packages}
'';
/*
Generates a vimrc string
packages is an attrset with {name: { start = [ vim derivations ]; opt = [ vim derivations ]; }
Example:
vimrcContent {
packages = { home-manager = { start = [vimPlugins.vim-fugitive]; opt = [];};
beforePlugins = '';
customRC = ''let mapleader = " "'';
};
*/
vimrcContent =
{
packages ? null,
vam ? null, # deprecated
pathogen ? null, # deprecated
plug ? null,
beforePlugins ? ''
" configuration generated by NIX
set nocompatible
'',
customRC ? null,
}:
let
# vim-plug is an extremely popular vim plugin manager.
plugImpl = ''
source ${vimPlugins.vim-plug}/plug.vim
silent! call plug#begin('/dev/null')
''
+ (lib.concatMapStringsSep "\n" (pkg: "Plug '${pkg}'") plug.plugins)
+ ''
call plug#end()
'';
# vim-addon-manager = VAM (deprecated)
vamImpl =
let
knownPlugins = vam.knownPlugins or vimPlugins;
# plugins specified by the user
specifiedPlugins = map (pluginToDrv knownPlugins) (
lib.concatMap vamDictToNames vam.pluginDictionaries
);
# plugins with dependencies
plugins = findDependenciesRecursively specifiedPlugins;
vamPackages.vam = {
start = plugins;
};
in
nativeImpl vamPackages;
entries = [
beforePlugins
]
++ lib.optional (vam != null) (
lib.warn "'vam' attribute is deprecated. Use 'packages' instead in your vim configuration" vamImpl
)
++ lib.optional (packages != null && packages != [ ]) (nativeImpl packages)
++ lib.optional (pathogen != null) (
throw "pathogen is now unsupported, replace `pathogen = {}` with `packages.home = { start = []; }`"
)
++ lib.optional (plug != null) plugImpl
++ [ customRC ];
in
lib.concatStringsSep "\n" (lib.filter (x: x != null && x != "") entries);
vimrcFile = settings: writeText "vimrc" (vimrcContent settings);
in
rec {
inherit vimrcFile;
inherit vimrcContent;
inherit packDir;
makeCustomizable =
let
mkVimrcFile = vimrcFile; # avoid conflict with argument name
in
vim:
vim
// {
# Returns a customized vim that uses the specified vimrc configuration.
customize =
{
# The name of the derivation.
name ? "vim",
# A shell word used to specify the names of the customized executables.
# The shell variable $exe can be used to refer to the wrapped executable's name.
# Examples: "my-$exe", "$exe-with-plugins", "\${exe/vim/v1m}"
executableName ?
if lib.hasInfix "vim" name then
lib.replaceStrings [ "vim" ] [ "$exe" ] name
else
"\${exe/vim/${lib.escapeShellArg name}}",
# A custom vimrc configuration, treated as an argument to vimrcContent (see the documentation in this file).
vimrcConfig ? null,
# A custom vimrc file.
vimrcFile ? null,
# A custom gvimrc file.
gvimrcFile ? null,
# If set to true, return the *vim wrappers only.
# If set to false, overlay the wrappers on top of the original vim derivation.
# This ensures that things like man pages and .desktop files are available.
standalone ? name != "vim" && wrapManual != true,
# deprecated arguments (TODO: remove eventually)
wrapManual ? null,
wrapGui ? null,
vimExecutableName ? null,
gvimExecutableName ? null,
}:
lib.warnIf (wrapManual != null)
''
vim.customize: wrapManual is deprecated: the manual is now included by default if `name == "vim"`.
${
if wrapManual == true && name != "vim" then
"Set `standalone = false` to include the manual."
else
lib.optionalString (
wrapManual == false && name == "vim"
) "Set `standalone = true` to get the *vim wrappers only."
}''
lib.warnIf
(wrapGui != null)
"vim.customize: wrapGui is deprecated: gvim is now automatically included if present"
lib.throwIfNot
(vimExecutableName == null && gvimExecutableName == null)
"vim.customize: (g)vimExecutableName is deprecated: use executableName instead (see source code for examples)"
(
let
vimrc =
if vimrcFile != null then
vimrcFile
else if vimrcConfig != null then
mkVimrcFile vimrcConfig
else
throw "at least one of vimrcConfig and vimrcFile must be specified";
bin = runCommand "${name}-bin" { nativeBuildInputs = [ makeWrapper ]; } ''
vimrc=${lib.escapeShellArg vimrc}
gvimrc=${lib.optionalString (gvimrcFile != null) (lib.escapeShellArg gvimrcFile)}
mkdir -p "$out/bin"
for exe in ${
if standalone then "{,g,r,rg,e}vim {,g}vimdiff vi" else "{,g,r,rg,e}{vim,view} {,g}vimdiff ex vi"
}; do
if [[ -e ${vim}/bin/$exe ]]; then
dest="$out/bin/${executableName}"
if [[ -e $dest ]]; then
echo "ambiguous executableName: ''${dest##*/} already exists"
continue
fi
makeWrapper ${vim}/bin/"$exe" "$dest" \
--add-flags "-u ''${vimrc@Q} ''${gvimrc:+-U ''${gvimrc@Q}}"
fi
done
'';
in
if standalone then
bin
else
buildEnv {
inherit name;
paths = [
(lib.lowPrio vim)
bin
];
}
);
override = f: makeCustomizable (vim.override f);
overrideAttrs = f: makeCustomizable (vim.overrideAttrs f);
};
vimGenDocHook = callPackage (
{ vim }:
makeSetupHook {
name = "vim-gen-doc-hook";
propagatedBuildInputs = [ vim ];
substitutions = {
vimBinary = "${vim}/bin/vim";
inherit rtpPath;
};
} ../hooks/vim-gen-doc-hook.sh
) { };
vimCommandCheckHook = callPackage (
{ neovim-unwrapped }:
makeSetupHook {
name = "vim-command-check-hook";
propagatedBuildInputs = [ neovim-unwrapped ];
substitutions = {
vimBinary = "${neovim-unwrapped}/bin/nvim";
inherit rtpPath;
};
} ../hooks/vim-command-check-hook.sh
) { };
neovimRequireCheckHook = callPackage (
{ neovim-unwrapped }:
makeSetupHook {
name = "neovim-require-check-hook";
propagatedBuildInputs = [ neovim-unwrapped ];
substitutions = {
nvimBinary = "${neovim-unwrapped}/bin/nvim";
inherit rtpPath;
};
} ../hooks/neovim-require-check-hook.sh
) { };
inherit
(import ./build-vim-plugin.nix {
inherit
lib
stdenv
rtpPath
toVimPlugin
;
})
buildVimPlugin
;
buildVimPluginFrom2Nix = lib.warn "buildVimPluginFrom2Nix is deprecated: use buildVimPlugin instead" buildVimPlugin;
# used to figure out which python dependencies etc. neovim needs
requiredPlugins =
{
packages ? { },
plug ? null,
...
}:
let
nativePluginsConfigs = lib.attrsets.attrValues packages;
nonNativePlugins = (lib.optionals (plug != null) plug.plugins);
nativePlugins = lib.concatMap requiredPluginsForPackage nativePluginsConfigs;
in
nativePlugins ++ nonNativePlugins;
# figures out which python dependencies etc. is needed for one vim package
requiredPluginsForPackage =
{
start ? [ ],
opt ? [ ],
}:
start ++ opt;
toVimPlugin =
drv:
drv.overrideAttrs (oldAttrs: {
name = "vimplugin-${oldAttrs.name}";
# dont move the "doc" folder since vim expects it
forceShare = [
"man"
"info"
];
nativeBuildInputs =
oldAttrs.nativeBuildInputs or [ ]
++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
vimGenDocHook
];
doCheck = oldAttrs.doCheck or true;
nativeCheckInputs =
oldAttrs.nativeCheckInputs or [ ]
++ lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
vimCommandCheckHook
# many neovim plugins keep using buildVimPlugin
neovimRequireCheckHook
];
passthru = (oldAttrs.passthru or { }) // {
vimPlugin = true;
};
});
}
// lib.optionalAttrs config.allowAliases {
vimWithRC = throw "vimWithRC was removed, please use vim.customize instead";
}

File diff suppressed because it is too large Load Diff