Skip to content

Commit

Permalink
plugins/remote-nvim: init
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Dec 12, 2024
1 parent c7b109f commit 54b1d91
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 0 deletions.
27 changes: 27 additions & 0 deletions plugins/by-name/remote-nvim/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ lib, ... }:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "remote-nvim";
originalName = "remote-nvim.nvim";
package = "remote-nvim-nvim";

maintainers = [ lib.maintainers.khaneliman ];

settingsExample = {
offline_mode = {
enabled = true;
no_github = true;
};
remote = {
copy_dirs = {
data = {
base.__raw = ''vim.fn.stdpath ("data")'';
dirs = [ "lazy" ];
compression = {
enabled = true;
additional_opts = [ "--exclude-vcs" ];
};
};
};
};
};
}
129 changes: 129 additions & 0 deletions tests/test-sources/plugins/by-name/remote-nvim/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
empty = {
plugins.remote-nvim.enable = true;
};

defaults = {
plugins.remote-nvim = {
enable = true;

settings = {
devpod = {
binary = "devpod";
docker_binary = "docker";
search_style = "current_dir_only";
dotfiles = {
path = null;
install_script = null;
};
gpg_agent_forwarding = false;
container_list = "running_only";
};
ssh_config = {
ssh_binary = "ssh";
scp_binary = "scp";
ssh_config_file_paths = [ "$HOME/.ssh/config" ];

ssh_prompts = [
{
match = "password:";
type = "secret";
value_type = "static";
value = "";
}
{
match = "continue connecting (yes/no/[fingerprint])?";
type = "plain";
value_type = "static";
value = "";
}
];
};

progress_view = {
type = "popup";
};

offline_mode = {
enabled = false;
no_github = false;
};

remote = {
app_name = "nvim";
copy_dirs = {
config = {
base.__raw = ''vim.fn.stdpath("config")'';
dirs = "*";
compression = {
enabled = false;
additional_opts = { };
};
};
data = {
base.__raw = ''vim.fn.stdpath("data")'';
dirs = { };
compression = {
enabled = true;
};
};
cache = {
base.__raw = ''vim.fn.stdpath("cache")'';
dirs = { };
compression = {
enabled = true;
};
};
state = {
base.__raw = ''vim.fn.stdpath("state")'';
dirs = { };
compression = {
enabled = true;
};
};
};
};

client_callback.__raw = ''
function(port, _)
require("remote-nvim.ui").float_term(("nvim --server localhost:%s --remote-ui"):format(port), function(exit_code)
if exit_code ~= 0 then
vim.notify(("Local client failed with exit code %s"):format(exit_code), vim.log.levels.ERROR)
end
end)
end
'';

log = {
level = "info";
max_size = 1024 * 1024 * 2;
};
};
};
};

example = {
plugins.remote-nvim = {
enable = true;

settings = {
offline_mode = {
enabled = true;
no_github = true;
};
remote = {
copy_dirs = {
data = {
base.__raw = ''vim.fn.stdpath ("data")'';
dirs = [ "lazy" ];
compression = {
enabled = true;
additional_opts = [ "--exclude-vcs" ];
};
};
};
};
};
};
};
}

0 comments on commit 54b1d91

Please sign in to comment.