Skip to content

Commit

Permalink
make himalaya-vim derivation use versions to reduce breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed Feb 15, 2023
1 parent 4fe7937 commit c4c6a60
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 41 deletions.
86 changes: 46 additions & 40 deletions pkgs/applications/editors/vim/plugins/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, buildGoModule
, buildVimPluginFrom2Nix
, fetchFromGitHub
, fetchFromSourcehut
, fetchpatch
, fetchurl
, substituteAll
Expand Down Expand Up @@ -488,12 +489,13 @@ self: super: {
});

himalaya-vim = super.himalaya-vim.overrideAttrs (old: {
postPatch = ''
substituteInPlace plugin/himalaya.vim \
--replace "if !executable('himalaya')" "if v:false"
substituteInPlace autoload/himalaya/request.vim \
--replace "'himalaya" "'${himalaya}/bin/himalaya"
'';
buildInputs = [ himalaya ];
src = fetchFromSourcehut {
owner = "~soywod";
repo = "himalaya-vim";
rev = "v${himalaya.version}";
sha256 = "W+91hnNeS6WkDiR9r1s7xPTK9JlCWiVkI/nXVYbepY0=";
};
});

jedi-vim = super.jedi-vim.overrideAttrs (old: {
Expand Down Expand Up @@ -578,28 +580,30 @@ self: super: {
dependencies = with self; [ plenary-nvim ];
});

markdown-preview-nvim = super.markdown-preview-nvim.overrideAttrs (old: let
# We only need its dependencies `node-modules`.
nodeDep = nodePackages."markdown-preview-nvim-../../applications/editors/vim/plugins/markdown-preview-nvim".overrideAttrs (old: {
dontNpmInstall = true;
});
in {
patches = [
(substituteAll {
src = ./markdown-preview-nvim/fix-node-paths.patch;
node = "${nodejs}/bin/node";
})
];
postInstall = ''
ln -s ${nodeDep}/lib/node_modules/markdown-preview/node_modules $out/app
'';
markdown-preview-nvim = super.markdown-preview-nvim.overrideAttrs (old:
let
# We only need its dependencies `node-modules`.
nodeDep = nodePackages."markdown-preview-nvim-../../applications/editors/vim/plugins/markdown-preview-nvim".overrideAttrs (old: {
dontNpmInstall = true;
});
in
{
patches = [
(substituteAll {
src = ./markdown-preview-nvim/fix-node-paths.patch;
node = "${nodejs}/bin/node";
})
];
postInstall = ''
ln -s ${nodeDep}/lib/node_modules/markdown-preview/node_modules $out/app
'';

nativeBuildInputs = [ nodejs ];
doInstallCheck = true;
installCheckPhase = ''
node $out/app/index.js --version
'';
});
nativeBuildInputs = [ nodejs ];
doInstallCheck = true;
installCheckPhase = ''
node $out/app/index.js --version
'';
});

mason-lspconfig-nvim = super.mason-lspconfig-nvim.overrideAttrs (old: {
dependencies = with self; [ mason-nvim nvim-lspconfig ];
Expand Down Expand Up @@ -660,7 +664,7 @@ self: super: {
dependencies = with self; [ plenary-nvim nui-nvim ];
});

noice-nvim = super.noice-nvim.overrideAttrs(old: {
noice-nvim = super.noice-nvim.overrideAttrs (old: {
dependencies = with self; [ nui-nvim nvim-notify ];
});

Expand Down Expand Up @@ -823,12 +827,14 @@ self: super: {
};

sqlite-lua = super.sqlite-lua.overrideAttrs (old: {
postPatch = let
libsqlite = "${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}";
in ''
substituteInPlace lua/sqlite/defs.lua \
--replace "path = vim.g.sqlite_clib_path" "path = vim.g.sqlite_clib_path or ${lib.escapeShellArg libsqlite}"
'';
postPatch =
let
libsqlite = "${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}";
in
''
substituteInPlace lua/sqlite/defs.lua \
--replace "path = vim.g.sqlite_clib_path" "path = vim.g.sqlite_clib_path or ${lib.escapeShellArg libsqlite}"
'';
});

ssr = super.ssr-nvim.overrideAttrs (old: {
Expand All @@ -850,11 +856,11 @@ self: super: {
};

stylish-nvim = super.stylish-nvim.overrideAttrs (old: {
postPatch = ''
substituteInPlace lua/stylish/common/mouse_hover_handler.lua --replace xdotool ${xdotool}/bin/xdotool
substituteInPlace lua/stylish/components/menu.lua --replace xdotool ${xdotool}/bin/xdotool
substituteInPlace lua/stylish/components/menu.lua --replace xwininfo ${xorg.xwininfo}/bin/xwininfo
'';
postPatch = ''
substituteInPlace lua/stylish/common/mouse_hover_handler.lua --replace xdotool ${xdotool}/bin/xdotool
substituteInPlace lua/stylish/components/menu.lua --replace xdotool ${xdotool}/bin/xdotool
substituteInPlace lua/stylish/components/menu.lua --replace xwininfo ${xorg.xwininfo}/bin/xwininfo
'';
});

sved =
Expand Down Expand Up @@ -971,7 +977,7 @@ self: super: {
cp "${ftdetect}" vim-plugin/ftdetect/tup.vim
cd vim-plugin
'';
meta.maintainers = with lib.maintainers; [enderger];
meta.maintainers = with lib.maintainers; [ enderger ];
};

unicode-vim =
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/vim/plugins/vim-plugin-names
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ https://github.com/wenzel-hoffman/haskell-with-unicode.vim/,HEAD,
https://github.com/travitch/hasksyn/,,
https://github.com/rebelot/heirline.nvim/,,
https://github.com/Yggdroot/hiPairs/,,
https://git.sr.ht/~soywod/himalaya-vim,,
https://github.com/mpickering/hlint-refactor-vim/,,
https://github.com/edluffy/hologram.nvim/,,
https://github.com/urbit/hoon.vim/,,
Expand Down Expand Up @@ -1174,4 +1175,3 @@ https://github.com/ziglang/zig.vim/,,
https://github.com/mickael-menu/zk-nvim/,HEAD,
https://github.com/troydm/zoomwintab.vim/,,
https://github.com/nanotee/zoxide.vim/,,
https://git.sr.ht/~soywod/himalaya-vim,,

0 comments on commit c4c6a60

Please sign in to comment.