From d19552a28d47b69dd5686d3a8abc9921408e0d58 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Tue, 16 Jul 2024 12:35:47 +0200 Subject: [PATCH] add repolink to neovim --- modules/tui/neovim.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/modules/tui/neovim.nix b/modules/tui/neovim.nix index d86ddaf..84d2dbe 100644 --- a/modules/tui/neovim.nix +++ b/modules/tui/neovim.nix @@ -69,6 +69,48 @@ in { extraPlugins = with pkgs.vimPlugins; { zen-mode.package = zen-mode-nvim; unicode.package = unicode-vim; + repolink = { + package = pkgs.stdenv.mkDerivation { + name = "repolink"; + src = pkgs.fetchFromGitHub { + owner = "9seconds"; + repo = "repolink.nvim"; + rev = "55edfedbaef3e894d2ab5107ea7fadc64cb8258d"; + hash = "sha256-ykCswLzq38tO0GE4IB0dT3g239qkKpoW+d27sCorR90="; + }; + installPhase = '' + runHook preInstall + + cp -r . $out + + runHook postInstall + ''; + }; + setup = /*lua*/'' + require("repolink").setup({ + use_full_commit_hash = true, + url_builders = { + ["github"] = require("repolink").url_builder_for_github("https://github.com"), + ["gitlab"] = require("repolink").url_builder_for_gitlab("https://gitlab.com"), + ["codeberg"] = require("repolink").url_builder_for_gitea("https://codeberg.org"), + ["jacekpoz"] = require("repolink").url_builder_for_gitea("https://git.jacekpoz.pl"), + ["outfoxxed"] = require("repolink").url_builder_for_gitea("https://git.outfoxxed.me"), + }, + custom_url_parser = function(remote_url) + local host, user, project = string.match( + remote_url, + "^([^:]+):([^/]+)/(.+)$" + ) + if host then + return host, { + user = user, + project = project + } + end + end + }) + ''; + }; }; treesitter = {