mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2026-05-07 18:18:01 +02:00
Merge e04a353093 into 88dbbad1f4
This commit is contained in:
commit
d5f52dba71
9 changed files with 116 additions and 1 deletions
|
|
@ -294,6 +294,7 @@ isMaximal: {
|
|||
|
||||
presence = {
|
||||
neocord.enable = false;
|
||||
cord-nvim.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -514,4 +514,10 @@ https://github.com/gorbit99/codewindow.nvim
|
|||
- Allow `vim.treesitter.context.setupOpts.max_lines` to also be given as a
|
||||
string in order to allow percentage values like `"20%"`
|
||||
|
||||
[Adam0](https://github.com/adam01110):
|
||||
|
||||
[cord.nvim]: https://github.com/vyfor/cord.nvim
|
||||
|
||||
- Add [cord.nvim] plugin in `vim.presence.cord` with `enable` and `setupOpts`
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
56
flake/pkgs/by-name/cord-nvim/package.nix
Normal file
56
flake/pkgs/by-name/cord-nvim/package.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
22
modules/plugins/rich-presence/cord-nvim/config.nix
Normal file
22
modules/plugins/rich-presence/cord-nvim/config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
cfg = config.vim.presence.cord-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
globals.cord_defer_startup = true;
|
||||
|
||||
lazy.plugins.cord-nvim = {
|
||||
package = "cord-nvim";
|
||||
setupModule = "cord";
|
||||
inherit (cfg) setupOpts;
|
||||
event = ["DeferredUIEnter"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
10
modules/plugins/rich-presence/cord-nvim/cord-nvim.nix
Normal file
10
modules/plugins/rich-presence/cord-nvim/cord-nvim.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.presence.cord-nvim = {
|
||||
enable = mkEnableOption "Discord rich presence [cord.nvim]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "cord.nvim" {};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/rich-presence/cord-nvim/default.nix
Normal file
6
modules/plugins/rich-presence/cord-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./cord-nvim.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./cord-nvim
|
||||
./neocord
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
# Get plugins built from source from self.packages
|
||||
# If adding a new plugin to be built from source, it must also be inherited
|
||||
# here.
|
||||
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim;
|
||||
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim cord-nvim;
|
||||
};
|
||||
|
||||
buildConfigPlugins = plugins:
|
||||
|
|
|
|||
|
|
@ -381,6 +381,19 @@
|
|||
"url": "https://github.com/zbirenbaum/copilot.lua/archive/0552b44fceedf0c4cba2cd4953d3976633b2509a.tar.gz",
|
||||
"hash": "sha256-PULc9fiFljpomXDBY1HeJDttImQf7lYprpNEx5MZO4Y="
|
||||
},
|
||||
"cord-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "vyfor",
|
||||
"repo": "cord.nvim"
|
||||
},
|
||||
"branch": "master",
|
||||
"submodules": false,
|
||||
"revision": "0be090969e978f7442870ef227e09eff7bf3480d",
|
||||
"url": "https://github.com/vyfor/cord.nvim/archive/0be090969e978f7442870ef227e09eff7bf3480d.tar.gz",
|
||||
"hash": "sha256-J1Hc38vrltbRQi+ztiMMu1G6z3N1PVtFxQ7qMGsgq00="
|
||||
},
|
||||
"crates-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue