aboutsummaryrefslogtreecommitdiffstats
path: root/modules/file-management/yazi
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-23 18:30:05 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-23 18:42:18 +0530
commit5032239a236595451f22ea948c42281f8aa04645 (patch)
tree5e6be8235a04614c676d8883c3c756e1b9a5f4ff /modules/file-management/yazi
parent2ad7b06ced0ffa39d20e6be41466e5bd834ee956 (diff)
downloadhome-manager-config-5032239a236595451f22ea948c42281f8aa04645.tar.gz
home-manager-config-5032239a236595451f22ea948c42281f8aa04645.zip
feat: migrate from lf to yazi as default file manager
- Replace lf module with yazi module including base16 theme - Remove file-preview and file-preview-clean scripts (no longer needed) - Add yazi-file-chooser script for XDG Desktop Portal integration - Update i3 keybinding to use yazi - Add GTK_USE_PORTAL and TERMCMD session variables - Add extraLinks support to mkScriptModule
Diffstat (limited to 'modules/file-management/yazi')
-rw-r--r--modules/file-management/yazi/default.nix32
-rw-r--r--modules/file-management/yazi/theme.nix258
2 files changed, 290 insertions, 0 deletions
diff --git a/modules/file-management/yazi/default.nix b/modules/file-management/yazi/default.nix
new file mode 100644
index 0000000..b43ed5e
--- /dev/null
+++ b/modules/file-management/yazi/default.nix
@@ -0,0 +1,32 @@
+# yazi - Terminal file manager with native previews
+{ config, lib, ... }:
+{
+ imports = [ ./theme.nix ];
+
+ options.file-management.yazi = {
+ enable = lib.mkEnableOption "Enables yazi.";
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = config.programs.yazi.finalPackage;
+ defaultText = lib.literalExpression "config.programs.yazi.finalPackage";
+ description = "The yazi package to use. Defaults to the wrapped finalPackage from programs.yazi.";
+ };
+ };
+
+ config = lib.mkIf config.file-management.yazi.enable {
+ programs.yazi = {
+ enable = true;
+ shellWrapperName = "yy";
+ enableZshIntegration = config.terminal.zsh.enable;
+ settings = {
+ mgr = {
+ show_hidden = true;
+ };
+ };
+ };
+
+ xdg.mimeApps.defaultApplications = {
+ "inode/directory" = "yazi.desktop";
+ };
+ };
+}
diff --git a/modules/file-management/yazi/theme.nix b/modules/file-management/yazi/theme.nix
new file mode 100644
index 0000000..e960d84
--- /dev/null
+++ b/modules/file-management/yazi/theme.nix
@@ -0,0 +1,258 @@
+{ config, lib, ... }:
+{
+ config = lib.mkIf config.file-management.yazi.enable {
+ programs.yazi.theme = with config.scheme.withHashtag; {
+ manager = {
+ cwd = {
+ fg = base0D;
+ };
+
+ hovered = {
+ fg = base00;
+ bg = base0D;
+ };
+ preview_hovered = {
+ underline = true;
+ };
+
+ find_keyword = {
+ fg = base0A;
+ italic = true;
+ };
+ find_position = {
+ fg = base0C;
+ bg = base00;
+ italic = true;
+ };
+
+ marker_selected = {
+ fg = base0B;
+ bg = base0B;
+ };
+ marker_copied = {
+ fg = base0A;
+ bg = base0A;
+ };
+ marker_cut = {
+ fg = base08;
+ bg = base08;
+ };
+
+ tab_active = {
+ fg = base00;
+ bg = base0D;
+ };
+ tab_inactive = {
+ fg = base05;
+ bg = base01;
+ };
+
+ count_copied = {
+ fg = base00;
+ bg = base0A;
+ };
+ count_cut = {
+ fg = base00;
+ bg = base08;
+ };
+ count_selected = {
+ fg = base00;
+ bg = base0B;
+ };
+
+ border_symbol = "│";
+ border_style = {
+ fg = base02;
+ };
+
+ syntect_theme = "";
+ };
+
+ status = {
+ separator_open = "";
+ separator_close = "";
+ separator_style = {
+ fg = base01;
+ bg = base01;
+ };
+
+ mode_normal_main = {
+ fg = base00;
+ bg = base0D;
+ bold = true;
+ };
+ mode_normal_alt = {
+ fg = base0D;
+ bg = base01;
+ };
+
+ mode_select_main = {
+ fg = base00;
+ bg = base0B;
+ bold = true;
+ };
+ mode_select_alt = {
+ fg = base0B;
+ bg = base01;
+ };
+
+ mode_unset_main = {
+ fg = base00;
+ bg = base0E;
+ bold = true;
+ };
+ mode_unset_alt = {
+ fg = base0E;
+ bg = base01;
+ };
+
+ progress_label = {
+ fg = base06;
+ bold = true;
+ };
+ progress_normal = {
+ fg = base0D;
+ bg = base01;
+ };
+ progress_error = {
+ fg = base08;
+ bg = base01;
+ };
+
+ permissions_t = {
+ fg = base0D;
+ };
+ permissions_r = {
+ fg = base0A;
+ };
+ permissions_w = {
+ fg = base08;
+ };
+ permissions_x = {
+ fg = base0B;
+ };
+ permissions_s = {
+ fg = base03;
+ };
+ };
+
+ input = {
+ border = {
+ fg = base0D;
+ };
+ selected = {
+ reversed = true;
+ };
+ };
+
+ select = {
+ border = {
+ fg = base0D;
+ };
+ active = {
+ fg = base0E;
+ };
+ };
+
+ tasks = {
+ border = {
+ fg = base0D;
+ };
+ hovered = {
+ underline = true;
+ };
+ };
+
+ which = {
+ mask = {
+ bg = base01;
+ };
+ cand = {
+ fg = base0C;
+ };
+ rest = {
+ fg = base04;
+ };
+ desc = {
+ fg = base0D;
+ };
+ separator = " ";
+ separator_style = {
+ fg = base03;
+ };
+ };
+
+ notify = {
+ title_info = {
+ fg = base0D;
+ };
+ title_warn = {
+ fg = base0A;
+ };
+ title_error = {
+ fg = base08;
+ };
+ };
+
+ pick = {
+ border = {
+ fg = base0D;
+ };
+ active = {
+ fg = base0E;
+ };
+ };
+
+ confirm = {
+ border = {
+ fg = base0D;
+ };
+ };
+
+ completion = {
+ border = {
+ fg = base0D;
+ };
+ active = {
+ fg = base00;
+ bg = base0D;
+ };
+ icon_file = "";
+ icon_folder = "";
+ icon_command = "";
+ };
+
+ mode = {
+ normal_main = {
+ fg = base00;
+ bg = base0D;
+ bold = true;
+ };
+ normal_alt = {
+ fg = base0D;
+ bg = base01;
+ };
+
+ select_main = {
+ fg = base00;
+ bg = base0B;
+ bold = true;
+ };
+ select_alt = {
+ fg = base0B;
+ bg = base01;
+ };
+
+ unset_main = {
+ fg = base00;
+ bg = base0E;
+ bold = true;
+ };
+ unset_alt = {
+ fg = base0E;
+ bg = base01;
+ };
+ };
+ };
+ };
+}