1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-29 13:19:47 +01:00
home-manager/tests/modules/programs/yazi/settings.nix

108 lines
2.4 KiB
Nix
Raw Normal View History

{ ... }:
{
programs.yazi = {
enable = true;
keymap = {
2024-12-01 18:47:01 +01:00
input.prepend_keymap = [
{
2024-12-01 18:47:01 +01:00
run = "close";
on = [ "<C-q>" ];
}
{
2024-12-01 18:47:01 +01:00
run = "close --submit";
on = [ "<Enter>" ];
}
{
2024-12-01 18:47:01 +01:00
run = "escape";
on = [ "<Esc>" ];
}
{
2024-12-01 18:47:01 +01:00
run = "backspace";
on = [ "<Backspace>" ];
}
];
2024-12-01 18:47:01 +01:00
manager.prepend_keymap = [
{
2024-12-01 18:47:01 +01:00
run = "escape";
on = [ "<Esc>" ];
}
{
2024-12-01 18:47:01 +01:00
run = "quit";
on = [ "q" ];
}
{
2024-12-01 18:47:01 +01:00
run = "close";
on = [ "<C-q>" ];
}
];
};
settings = {
log = { enabled = false; };
manager = {
show_hidden = false;
sort_by = "modified";
sort_dir_first = true;
sort_reverse = true;
};
};
theme = {
filetype = {
rules = [
{
fg = "#7AD9E5";
mime = "image/*";
}
{
fg = "#F3D398";
mime = "video/*";
}
{
fg = "#F3D398";
mime = "audio/*";
}
{
fg = "#CD9EFC";
mime = "application/x-bzip";
}
];
};
};
2024-05-29 05:01:52 +02:00
initLua = ./init.lua;
plugins = {
testplugin = ./plugin;
## Produces warning
#"plugin-with-suffix.yazi" = ./plugin;
## Fails assertion
#single-file-plugin = ./plugin/init.lua;
#empty-dir-plugin = ./empty;
};
flavors = {
testflavor = ./flavor;
## Produces warning
#"flavor-with-suffix.yazi" = ./flavor;
## Fails assertion
#single-file-flavor = ./flavor/flavor.toml;
#empty-dir-flavor = ./empty;
};
};
test.stubs.yazi = { };
nmt.script = ''
assertFileContent home-files/.config/yazi/keymap.toml \
${./keymap-expected.toml}
assertFileContent home-files/.config/yazi/yazi.toml \
${./settings-expected.toml}
assertFileContent home-files/.config/yazi/theme.toml \
${./theme-expected.toml}
2024-05-29 05:01:52 +02:00
assertFileContent home-files/.config/yazi/init.lua \
${./init.lua}
assertFileContent home-files/.config/yazi/plugins/testplugin.yazi/init.lua \
${./plugin/init.lua}
assertFileContent home-files/.config/yazi/flavors/testflavor.yazi/flavor.toml \
${./flavor/flavor.toml}
'';
}