From 5b8dfde8c2c8ef91508cfc2190163103bb6dfac4 Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 13 Aug 2026 18:32:47 +0300 Subject: [PATCH] fix yazi --- home/users/{ => modules}/yazi.nix | 20 ++++++++++++++++++-- home/users/thek4n.nix | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) rename home/users/{ => modules}/yazi.nix (83%) diff --git a/home/users/yazi.nix b/home/users/modules/yazi.nix similarity index 83% rename from home/users/yazi.nix rename to home/users/modules/yazi.nix index 0598fef..8e3b8b2 100644 --- a/home/users/yazi.nix +++ b/home/users/modules/yazi.nix @@ -4,6 +4,24 @@ programs.yazi = { enable = true; + initLua = '' +function Linemode:size_and_mtime() + local time = math.floor(self._file.cha.mtime or 0) + if time == 0 then + time = "" + elseif os.date("%Y", time) == os.date("%Y") then + time = os.date("%b %d %H:%M", time) + else + time = os.date("%b %d %Y", time) + end + + local size = self._file:size() + return string.format("%s %s", size and ya.readable_size(size) or "-", time) +end + +require("git"):setup() + ''; + # Основные настройки settings = { manager = { @@ -66,9 +84,7 @@ ]; }; - # Плагины plugins = { - git.package = pkgs.yaziPlugins.git; mount.package = pkgs.yaziPlugins.mount; jump-to-char.package = pkgs.yaziPlugins.jump-to-char; smart-enter.package = pkgs.yaziPlugins.smart-enter; diff --git a/home/users/thek4n.nix b/home/users/thek4n.nix index 8a7db54..c6d6675 100644 --- a/home/users/thek4n.nix +++ b/home/users/thek4n.nix @@ -42,6 +42,6 @@ }; imports = [ - ./yazi.nix + ./modules/yazi.nix ]; }