feat(devkit): yazi wrapper
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
git = pkgs.callPackage ./git {};
|
git = pkgs.callPackage ./git {};
|
||||||
lazygit = pkgs.callPackage ./lazygit {};
|
lazygit = pkgs.callPackage ./lazygit {};
|
||||||
starship = pkgs.callPackage ./starship {};
|
starship = pkgs.callPackage ./starship {};
|
||||||
|
yazi = pkgs.callPackage ./yazi {};
|
||||||
}
|
}
|
||||||
|
|||||||
43
packages/devkit/yazi/default.nix
Normal file
43
packages/devkit/yazi/default.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
symlinkJoin,
|
||||||
|
makeWrapper,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
yazi ? pkgs.yazi,
|
||||||
|
paths ? [],
|
||||||
|
}: let
|
||||||
|
drv = symlinkJoin ({
|
||||||
|
paths = yazi;
|
||||||
|
|
||||||
|
nativeBuildInputs = [makeWrapper];
|
||||||
|
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/yazi ${
|
||||||
|
if (builtins.length paths) > 0
|
||||||
|
then "$PATH:${lib.makeBinPath paths}"
|
||||||
|
else ""
|
||||||
|
} --set-default YAZI_CONFIG_HOME ${./.}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
// {inherit (yazi) name pname meta;});
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation (rec {
|
||||||
|
name = drv.name;
|
||||||
|
pname = drv.pname;
|
||||||
|
|
||||||
|
buildCommand = let
|
||||||
|
desktopEntry = pkgs.makeDesktopItem {
|
||||||
|
name = pname;
|
||||||
|
desktopName = name;
|
||||||
|
exec = "${lib.getExe drv}";
|
||||||
|
terminal = true;
|
||||||
|
};
|
||||||
|
in ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp ${lib.getExe drv} $out/bin
|
||||||
|
|
||||||
|
mkdir -p $out/share/applications
|
||||||
|
cp ${desktopEntry}/share/applications/${pname}.desktop $out/share/applications/${pname}.desktop
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
// {inherit (yazi) meta;})
|
||||||
24
packages/devkit/yazi/init.lua
Normal file
24
packages/devkit/yazi/init.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
-- Add username and hostname in header
|
||||||
|
-- https://yazi-rs.github.io/docs/tips#username-hostname-in-header
|
||||||
|
Header:children_add(function()
|
||||||
|
if ya.target_family() ~= "unix" then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue")
|
||||||
|
end, 500, Header.LEFT)
|
||||||
|
|
||||||
|
-- Add user and group owner of file in status line
|
||||||
|
-- https://yazi-rs.github.io/docs/tips#user-group-in-status
|
||||||
|
Status:children_add(function()
|
||||||
|
local h = cx.active.current.hovered
|
||||||
|
if h == nil or ya.target_family() ~= "unix" then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
return ui.Line({
|
||||||
|
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
|
||||||
|
":",
|
||||||
|
ui.Span(ya.user_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
|
||||||
|
" ",
|
||||||
|
})
|
||||||
|
end, 500, Status.RIGHT)
|
||||||
0
packages/devkit/yazi/keymaps.toml
Normal file
0
packages/devkit/yazi/keymaps.toml
Normal file
0
packages/devkit/yazi/theme.toml
Normal file
0
packages/devkit/yazi/theme.toml
Normal file
10
packages/devkit/yazi/yazi.toml
Normal file
10
packages/devkit/yazi/yazi.toml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[manager]
|
||||||
|
show_hidden = true
|
||||||
|
show_symlink = true
|
||||||
|
|
||||||
|
sort_by = "natural"
|
||||||
|
sort_dir_first = true
|
||||||
|
sort_sensitive = false
|
||||||
|
sort_translit = true
|
||||||
|
|
||||||
|
linemode = "size"
|
||||||
Reference in New Issue
Block a user