Flake for my NixOS devices
at silly-iso 159 lines 4.2 kB view raw
1{...}: { 2 config, 3 lib, 4 pkgs, 5 ... 6}: { 7 options.cow.yazi.enable = 8 lib.mkEnableOption "Yazi + Customizations" 9 // { 10 default = true; 11 }; 12 13 config = lib.mkIf config.cow.yazi.enable { 14 home.packages = with pkgs; [ 15 yazi 16 mediainfo 17 exiftool 18 ]; 19 20 programs.yazi = { 21 enable = true; 22 enableBashIntegration = true; 23 enableNushellIntegration = true; 24 25 settings = { 26 open.prepend_rules = [ 27 { 28 mime = "video/*"; 29 use = "open"; 30 } 31 { 32 mime = "audio/*"; 33 use = "open"; 34 } 35 ]; 36 }; 37 38 keymap.mgr.prepend_keymap = [ 39 { 40 run = "plugin mount"; 41 on = ["M"]; 42 desc = "Disk Mounting"; 43 } 44 { 45 run = "plugin chmod"; 46 on = [ 47 "c" 48 "m" 49 ]; 50 desc = "Run Chmod On Selected"; 51 } 52 ]; 53 54 plugins = { 55 inherit 56 (pkgs.yaziPlugins) 57 ouch 58 mount 59 chmod 60 bypass 61 mediainfo 62 wl-clipboard 63 yatline-catppuccin 64 ; 65 yatline = pkgs.yaziPlugins.yatline.overrideAttrs ( 66 _: _: { 67 version = "25.5.31-unstable-2026-01-05"; 68 src = pkgs.fetchFromGitHub { 69 owner = "carlosedp"; 70 repo = "yatline.yazi"; 71 rev = "e9589884cbdd7cc2283523fdb94f1c4c717a6de7"; 72 sha256 = "sha256-TiMY4XEfrHUKDDw1GRoYQU4mjrIEPEy7NwDoYuUyMic="; 73 }; 74 } 75 ); 76 }; 77 78 initLua = '' 79 local catppuccin_theme = require("yatline-catppuccin"):setup("mocha") 80 81 require("yatline"):setup({ 82 theme = catppuccin_theme, 83 section_separator = { open = "", close = "" }, 84 part_separator = { open = "", close = "" }, 85 inverse_separator = { open = "", close = "" }, 86 87 tab_width = 20, 88 tab_use_inverse = false, 89 90 selected = { icon = "󰻭", fg = "yellow" }, 91 copied = { icon = "", fg = "green" }, 92 cut = { icon = "", fg = "red" }, 93 94 total = { icon = "󰮍", fg = "yellow" }, 95 succ = { icon = "", fg = "green" }, 96 fail = { icon = "", fg = "red" }, 97 found = { icon = "󰮕", fg = "blue" }, 98 processed = { icon = "󰐍", fg = "green" }, 99 100 show_background = true, 101 102 display_header_line = true, 103 display_status_line = true, 104 105 component_positions = { "header", "tab", "status" }, 106 107 header_line = { 108 left = { 109 section_a = { 110 {type = "line", custom = false, name = "tabs", params = {"left"}}, 111 }, 112 section_b = { 113 }, 114 section_c = { 115 } 116 }, 117 right = { 118 section_a = { 119 {type = "string", custom = false, name = "date", params = {"%A, %d %B %Y"}}, 120 }, 121 section_b = { 122 {type = "string", custom = false, name = "date", params = {"%X"}}, 123 }, 124 section_c = { 125 } 126 } 127 }, 128 129 status_line = { 130 left = { 131 section_a = { 132 {type = "string", custom = false, name = "tab_mode"}, 133 }, 134 section_b = { 135 {type = "string", custom = false, name = "hovered_size"}, 136 }, 137 section_c = { 138 {type = "string", custom = false, name = "hovered_path"}, 139 {type = "coloreds", custom = false, name = "count"}, 140 } 141 }, 142 right = { 143 section_a = { 144 {type = "string", custom = false, name = "cursor_position"}, 145 }, 146 section_b = { 147 {type = "string", custom = false, name = "cursor_percentage"}, 148 }, 149 section_c = { 150 {type = "string", custom = false, name = "hovered_file_extension", params = {true}}, 151 {type = "coloreds", custom = false, name = "permissions"}, 152 } 153 } 154 }, 155 }) 156 ''; 157 }; 158 }; 159}