Yazi: show file sizes in Si notation.

This commit is contained in:
Dmitry Voronin 2025-04-03 16:51:40 +03:00
parent 7885809c5e
commit cbdfdcb9eb
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
4 changed files with 15 additions and 4 deletions
home/file
host/x86_64-linux/home

View file

@ -24,6 +24,7 @@ in
".config/tmux/tmux.conf".source = (import ./tmux args).config;
".config/waybar/config".source = waybar.config;
".config/waybar/style.css".source = waybar.style;
".config/yazi/init.lua".source = yazi.init;
".config/yazi/keymap.toml".source = yazi.keymap;
".config/yazi/theme.toml".source = yazi.theme;
".config/yazi/yazi.toml".source = yazi.yazi;

View file

@ -5,6 +5,7 @@
...
}@args:
{
init = ./module/init.lua;
keymap = (import ./module/keymap.nix args).file;
theme = (import ./module/theme.nix args).file;
yazi = (import ./module/yazi.nix args).file;

View file

@ -0,0 +1,10 @@
function ya.readable_size(size)
local units = { "B", "K", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q" }
local base = 1000
local i = 1
while size > base and i < #units do
size = size / base
i = i + 1
end
return string.format("%.1f%s", size, units[i]):gsub("[.,]0", "", 1)
end

View file

@ -1,5 +1,4 @@
{ secret, ... }: {
users.users.root.openssh.authorizedKeys.keys = [
secret.network.host.desktop.key
];
{ secret, ... }:
{
users.users.root.openssh.authorizedKeys.keys = [ secret.network.host.desktop.key ];
}