Oxidize CLI

- Remove bashmount
- Remove unzip
- Add yazi
- Add ouch
- Add zoxide
- Add mediainfo

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-06-07 20:27:55 +01:00
parent 515458d11f
commit b388794f40
11 changed files with 327 additions and 41 deletions

View File

@@ -0,0 +1,193 @@
{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user};
in
{
home-manager.users.${user} = {
programs = {
yazi = {
enable = true;
enableZshIntegration = true;
settings = {
mgr = {
show_hidden = true;
};
opener = {
edit =
[
{
run = "${hmConfig.programs.neovim.finalPackage}/bin/nvim \"$@\"";
desc = "nvim";
block = true;
}
]
++ lib.lists.optional hmConfig.programs.vscode.enable {
run = "${hmConfig.programs.vscode.package}/bin/code \"$@\"";
desc = "code";
orphan = true;
};
open = [
{
run = "xdg-open \"$1\"";
desc = "Open";
}
];
reveal = [
{
run = "xdg-open \"$(dirname \"$1\")\"";
desc = "Reveal";
}
];
extract = [
{
run = "ouch d -y \"$@\"";
desc = "Extract here with ouch";
}
];
play = [
{
run = "mpv \"$@\"";
orphan = true;
}
];
};
plugin = {
prepend_preloaders = [
{
mime = "{audio,video,image}/*";
run = "mediainfo";
}
{
mime = "application/subrip";
run = "mediainfo";
}
];
prepend_previewers = [
{
mime = "{audio,video,image}/*";
run = "mediainfo";
}
{
mime = "application/subrip";
run = "mediainfo";
}
{
mime = "application/*zip";
run = "ouch";
}
{
mime = "application/x-tar";
run = "ouch";
}
{
mime = "application/x-bzip2";
run = "ouch";
}
{
mime = "application/x-7z-compressed";
run = "ouch";
}
{
mime = "application/x-rar";
run = "ouch";
}
{
mime = "application/x-xz";
run = "ouch";
}
{
mime = "application/xz";
run = "ouch";
}
];
};
};
keymap = {
mgr.prepend_keymap = [
{
on = "<Enter>";
run = "plugin smart-enter";
desc = "Enter the child directory, or open the file";
}
{
on = "!";
run = "shell \"$SHELL\" --block";
desc = "Open $SHELL here";
}
{
on = "C";
run = "plugin ouch";
desc = "Compress";
}
{
on = "M";
run = "plugin chmod";
desc = "Chmod on selected files";
}
{
on = "<C-m>";
run = "plugin mount";
desc = "Open the mount menu";
}
];
};
initLua = ''
Status:children_add(function(self)
local h = self._current.hovered
if not h or not h.link_to then
return ""
end
return " -> " .. tostring(h.link_to)
end, 3300, Status.LEFT)
Status:children_add(function()
local h = cx.active.current.hovered
if not h then
return ""
end
return ui.Line {
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)),
":",
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)),
" ",
}
end, 500, Status.RIGHT)
'';
plugins = with pkgs.yaziPlugins; {
inherit
smart-enter
chmod
ouch
mount
mediainfo
;
};
};
zsh = {
shellAliases.y = "yazi";
p10k.extraRightPromptElements = [ "yazi" ];
};
};
theme.template.".config/yazi/theme.toml".source = ./theme.toml;
};
}

View File

@@ -0,0 +1,101 @@
[mgr]
cwd = { fg = "{{colors.primary.default.hex}}" }
preview_hovered = { underline = false }
find_keyword = { fg = "{{colors.error.default.hex}}", bold = true, italic = true, underline = true }
find_position = { fg = "{{colors.error.default.hex}}", bg = "reset", bold = true, italic = true }
marker_copied = { fg = "{{colors.secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" }
marker_cut = { fg = "{{colors.warning.default.hex}}", bg = "{{colors.warning.default.hex}}" }
marker_marked = { fg = "{{colors.error.default.hex}}", bg = "{{colors.error.default.hex}}" }
marker_selected = { fg = "{{colors.primary.default.hex}}", bg = "{{colors.primary.default.hex}}" }
count_copied = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}" }
count_cut = { fg = "{{colors.on_warning.default.hex}}", bg = "{{colors.warning.default.hex}}" }
count_selected = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}" }
border_style = { fg = "{{colors.outline.default.hex}}" }
[tabs]
active = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}", bold = true }
inactive = { fg = "{{colors.on_surface_variant.default.hex}}", bg = "{{colors.surface_dim.default.hex}}" }
sep_inner = { open = "", close = "" }
sep_outer = { open = "", close = "" }
[mode]
normal_main = { fg = "{{colors.on_primary.default.hex}}", bg = "{{colors.primary.default.hex}}", bold = true }
normal_alt = { fg = "{{colors.on_primary_container.default.hex}}", bg = "{{colors.primary_container.default.hex}}" }
select_main = { fg = "{{colors.on_secondary.default.hex}}", bg = "{{colors.secondary.default.hex}}", bold = true }
select_alt = { fg = "{{colors.on_secondary_container.default.hex}}", bg = "{{colors.secondary_container.default.hex}}" }
unset_main = { fg = "{{colors.on_tertiary.default.hex}}", bg = "{{colors.tertiary.default.hex}}", bold = true }
unset_alt = { fg = "{{colors.on_tertiary_container.default.hex}}", bg = "{{colors.tertiary_container.default.hex}}" }
[status]
sep_left = { open = "", close = "" }
sep_right = { open = "", close = "" }
perm_sep = { fg = "{{colors.scrim.default.hex}}" }
perm_type = { fg = "{{colors.primary.default.hex}}" }
perm_read = { fg = "{{colors.primary.default.hex}}" }
perm_write = { fg = "{{colors.secondary.default.hex}}" }
perm_exec = { fg = "{{colors.tertiary.default.hex}}" }
progress_label = { bold = true }
progress_normal = { fg = "{{colors.primary.default.hex}}", bg = "{{colors.primary_container.default.hex}}" }
progress_error = { fg = "{{colors.error.default.hex}}", bg = "{{colors.error_container.default.hex}}" }
[which]
mask = { bg = "{{colors.surface.default.hex}}" }
cand = { fg = "{{colors.primary.default.hex}}" }
rest = { fg = "{{colors.primary_container.default.hex}}" }
desc = { fg = "{{colors.on_surface.default.hex}}" }
separator_style = { fg = "{{colors.scrim.default.hex}}" }
[confirm]
border = { fg = "{{colors.primary.default.hex}}" }
title = { fg = "{{colors.primary.default.hex}}" }
[spot]
border = { fg = "{{colors.primary.default.hex}}" }
title = { fg = "{{colors.primary.default.hex}}" }
tbl_col = { fg = "{{colors.primary.default.hex}}" }
tbl_cell = { fg = "{{colors.secondary.default.hex}}", reversed = true }
[notify]
title_info = { fg = "{{colors.info.default.hex}}" }
title_warn = { fg = "{{colors.warning.default.hex}}" }
title_error = { fg = "{{colors.error.default.hex}}" }
[pick]
border = { fg = "{{colors.primary.default.hex}}" }
active = { fg = "{{colors.secondary.default.hex}}", bold = true }
[input]
border = { fg = "{{colors.primary.default.hex}}" }
[cmp]
border = { fg = "{{colors.primary.default.hex}}" }
[tasks]
border = { fg = "{{colors.primary.default.hex}}" }
hovered = { fg = "{{colors.secondary.default.hex}}", bold = true }
[help]
on = { fg = "{{colors.primary.default.hex}}" }
run = { fg = "{{colors.secondary.default.hex}}" }
footer = { fg = "{{colors.surface.default.hex}}", bg = "{{colors.on_surface.default.hex}}" }
[icon]
prepend_dirs = [
{ name = ".cache", text = "" },
{ name = ".local", text = "󱋣" },
{ name = "Games", text = "" },
{ name = "git", text = "" },
{ name = "Templates", text = "" },
{ name = "VMs", text = "" },
]