Plugins when using NixOS home-manager #1276
Replies: 3 comments 5 replies
-
For context, this is what I was doing when I was trying without home-manager. The top of my configuration.nix file: { config, pkgs, inputs, ... }:
let
yaziBookmarkSrc = pkgs.fetchFromGitHub {
owner = "dedukun";
repo = "bookmarks.yazi";
rev = "08b3f85c5d52656157a55e10410050b042f5b314";
sha256 = "sha256-t3MKmmNABMMphnfpIOQiSfn34HwNo8RkWr7+jeD7xfI=";
};
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
]; The yazi config: programs.yazi = {
enable = true;
# enableZshIntegration = true;
settings = {
keymap = {
manager.prepend_keymap = [
{ run = "close"; on = [ "<C-q>" ]; }
{ run = "yank --cut"; on = [ "d" ]; }
{ run = "remove --force"; on = [ "D" ]; }
{ run = "remove --permanently"; on = [ "X" ]; }
{
run = "plugin bookmarks --args=save";
on = [ "m" ];
desc = "Save current position as a bookmark";
}
{
run = "plugin bookmarks --args=jump";
on = [ "'" ];
desc = "Jump to a bookmark";
}
{
run = "plugin bookmarks --args=delete";
on = [ "b" "d" ];
desc = "Delete a bookmark";
}
{
run = "plugin bookmarks --args=delete_all";
on = [ "b" "D" ];
desc = "Delete all bookmarks";
}
];
};
yazi = {
manager = {
show_hidden = true;
};
opener.edit = [
{ run = "nvim \"$@\""; block = true; }
];
};
};
plugins = {
bookmarks = yaziBookmarkSrc;
};
}; Just in case it helps :) |
Beta Was this translation helpful? Give feedback.
-
Hi, I've added an example to the docs here yazi-rs/yazi-rs.github.io@5388f12 to demonstrate configuring Yazi with home-manager, hope it helps |
Beta Was this translation helpful? Give feedback.
-
Hey, has anyone figured out how to write plugin code directly into your config file? For example, to add the code for file navigation wraparound as shown on the tips page. I've tried writeScriptDir and other similar builders but can't get anything working. |
Beta Was this translation helpful? Give feedback.
-
Hi there!
I am fairly new to both NixOS and yazi, so hopefully my n00b status isn't too aggravating. I have yazi installed and configured via home manager
but I see, unlike in configuration.nix, there's no option for plugins. I wanted to add a bookmarks plugin, so I switched over to configuration.nix. I tried to get it to use fetchFromGitHub, and then pass that as an attribute to the plugins option, but it simply wouldn't build (apparently it wasn't happy with me trying to coerce a function to a string? I don't really know what these fetcher functions return tbh, the documentation sent me in circles).
Long story short, my question is this: is there a simple way to use plugins with home-manager? It seems a shame to lose the plugin ecosystem when using nix, but I can't seem to work it out in configuration.nix, and home-manager doesn't have the option at all, right?
Beta Was this translation helpful? Give feedback.
All reactions