rich-presence/cord-nvim: init

This commit is contained in:
Adam0 2026-04-27 16:12:28 +02:00
commit e04a353093
No known key found for this signature in database
GPG key ID: 0FFE5DE6328D5EC9
9 changed files with 116 additions and 1 deletions

View file

@ -0,0 +1,56 @@
{
lib,
pins,
fetchFromGitHub,
rustPlatform,
stdenv,
vimUtils,
}: let
pin = pins.cord-nvim;
pname = "cord";
version = pin.revision;
src = fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
cord-server = rustPlatform.buildRustPackage {
inherit pname version src;
postPatch = ''
substituteInPlace .github/server-version.txt \
--replace-fail "2.3.13" "${version}"
'';
cargoHash = "sha256-/O+jOaA0PinUiEVILNEF+vUS7Kh3XAwWyFqSvD54rGM=";
doCheck = false;
env.RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup";
meta.mainProgram = "cord";
};
in
vimUtils.buildVimPlugin {
pname = "cord-nvim";
inherit version src;
doCheck = false;
postPatch = ''
substituteInPlace lua/cord/server/fs/init.lua \
--replace-fail "or M.get_data_path()" "or '${cord-server}'"
substituteInPlace lua/cord/api/config/init.lua \
--replace-fail "update = 'fetch'," "update = 'none'," \
--replace-fail "auto_update = true," "auto_update = false,"
'';
meta = {
description = "Discord rich presence plugin for Neovim";
homepage = "https://github.com/vyfor/cord.nvim";
license = lib.licenses.asl20;
};
}