Compare commits
3 commits
d3a656dd92
...
7dc459072c
| Author | SHA1 | Date | |
|---|---|---|---|
| 7dc459072c | |||
| 3695e6c78a | |||
| 0eafd7a943 |
5 changed files with 165 additions and 171 deletions
|
|
@ -47,17 +47,15 @@
|
||||||
crony.wayland.enable = true;
|
crony.wayland.enable = true;
|
||||||
crony.hyprland.enable = true;
|
crony.hyprland.enable = true;
|
||||||
crony.neovim.enable = true;
|
crony.neovim.enable = true;
|
||||||
# crony.qutebrowser.enable = true;
|
|
||||||
crony.mpv.enable = true;
|
crony.mpv.enable = true;
|
||||||
# crony.browsers.enable = true;
|
|
||||||
crony.desktop.enable = true;
|
crony.desktop.enable = true;
|
||||||
crony.shell-additions.enable = true;
|
crony.shell-additions.enable = true;
|
||||||
crony.home-secrets.enable = true;
|
crony.home-secrets.enable = true;
|
||||||
crony.restic.enable = true;
|
crony.restic.enable = true;
|
||||||
crony.emulators.enable = true;
|
crony.emulators.enable = true;
|
||||||
# crony.emacs.enable = true;
|
|
||||||
crony.zen-browser.enable = true;
|
crony.zen-browser.enable = true;
|
||||||
crony.lnxlink.enable = true;
|
crony.lnxlink.enable = true;
|
||||||
|
crony.yazi.enable = true;
|
||||||
|
|
||||||
# DO NOT CHANGE ALSO
|
# DO NOT CHANGE ALSO
|
||||||
home.stateVersion = "24.11"; # Please read the comment before changing.
|
home.stateVersion = "24.11"; # Please read the comment before changing.
|
||||||
|
|
|
||||||
|
|
@ -18,25 +18,6 @@ mvln () {
|
||||||
ln -s $to $from
|
ln -s $to $from
|
||||||
}
|
}
|
||||||
|
|
||||||
# nnn
|
|
||||||
n () {
|
|
||||||
# Block nesting of nnn in subshells
|
|
||||||
[ "${NNNLVL:-0}" -eq 0 ] || {
|
|
||||||
echo "nnn is already running"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
# Tempfile location
|
|
||||||
NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
|
||||||
|
|
||||||
nnn "$@"
|
|
||||||
|
|
||||||
[ ! -f "$NNN_TMPFILE" ] || {
|
|
||||||
. "$NNN_TMPFILE"
|
|
||||||
rm -f "$NNN_TMPFILE" > /dev/null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# upfast
|
# upfast
|
||||||
upfast () {
|
upfast () {
|
||||||
curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/"
|
curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
./scripts.nix
|
./scripts.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
|
./yazi.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
crony.neovim.enable = lib.mkDefault false;
|
crony.neovim.enable = lib.mkDefault false;
|
||||||
|
|
@ -12,4 +13,5 @@
|
||||||
crony.tmux.enable = lib.mkDefault true;
|
crony.tmux.enable = lib.mkDefault true;
|
||||||
crony.zsh.enable = lib.mkDefault true;
|
crony.zsh.enable = lib.mkDefault true;
|
||||||
crony.scripts.enable = lib.mkDefault true;
|
crony.scripts.enable = lib.mkDefault true;
|
||||||
|
crony.yazi.enable = lib.mkDefault false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
email = "crony@cronyakatsuki.xyz";
|
email = "crony@cronyakatsuki.xyz";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
delta.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Install fzf
|
# Install fzf
|
||||||
|
|
@ -141,154 +142,5 @@
|
||||||
filter_mode = "directory";
|
filter_mode = "directory";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Install and setup yazi
|
|
||||||
programs.yazi = {
|
|
||||||
enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
shellWrapperName = "y";
|
|
||||||
settings = {
|
|
||||||
mgr = {
|
|
||||||
ratio = [0 4 4];
|
|
||||||
sort_by = "natural";
|
|
||||||
show_hidden = true;
|
|
||||||
show_symlink = false;
|
|
||||||
};
|
|
||||||
plugin = {
|
|
||||||
prepend_fetchers = [
|
|
||||||
{
|
|
||||||
id = "git";
|
|
||||||
name = "*";
|
|
||||||
run = "git";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
id = "git";
|
|
||||||
name = "*/";
|
|
||||||
run = "git";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
prepend_previewers = [
|
|
||||||
# Archive previewer
|
|
||||||
{
|
|
||||||
mime = "application/*zip";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-tar";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-bzip2";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-7z-compressed";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-rar";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/vnd.rar";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-xz";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/xz";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/x-zstd";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/zstd";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
mime = "application/java-archive";
|
|
||||||
run = "ouch";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
opener = {
|
|
||||||
extract = [
|
|
||||||
{
|
|
||||||
run = "ouch -d -y \"$@\"";
|
|
||||||
desc = "Extract here with ouch";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
plugins = {
|
|
||||||
full-border = pkgs.yaziPlugins.full-border;
|
|
||||||
smart-enter = pkgs.yaziPlugins.smart-enter;
|
|
||||||
smart-tab = ./yazi/smart-tab;
|
|
||||||
folder-rules = ./yazi/folder-rules;
|
|
||||||
toggle-pane = pkgs.yaziPlugins.toggle-pane;
|
|
||||||
parent-arrow = ./yazi/parent-arrow;
|
|
||||||
chmod = pkgs.yaziPlugins.chmod;
|
|
||||||
ouch = pkgs.yaziPlugins.ouch;
|
|
||||||
git = pkgs.yaziPlugins.git;
|
|
||||||
mount = pkgs.yaziPlugins.mount;
|
|
||||||
};
|
|
||||||
initLua = ./yazi/init.lua;
|
|
||||||
keymap = {
|
|
||||||
mgr.prepend_keymap = [
|
|
||||||
{
|
|
||||||
on = "l";
|
|
||||||
run = "plugin smart-enter";
|
|
||||||
desc = "Enter the child directory, or open the file";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "t";
|
|
||||||
run = "plugin smart-tab";
|
|
||||||
desc = "Create a tab and enter the howered directory";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "<C-w>";
|
|
||||||
for = "linux";
|
|
||||||
run = "shell -- hyprctl hyprpaper reload , \"$0\"";
|
|
||||||
desc = "Set howered file as wallpaper";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = [" " "p"];
|
|
||||||
run = "plugin toggle-pane min-preview";
|
|
||||||
desc = "Show or hide the preview pane";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "K";
|
|
||||||
run = "plugin parent-arrow -1";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "J";
|
|
||||||
run = "plugin parent-arrow 1";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = ["g" "r"];
|
|
||||||
run = "shell -- ya emit cd \"$(git rev-parse --show-toplevel)\"";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = ["c" "m"];
|
|
||||||
run = "plugin chmod";
|
|
||||||
desc = "Chmod on selected files";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "C";
|
|
||||||
run = "plugin ouch tar.gz";
|
|
||||||
desc = "Compress with ouch";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
on = "M";
|
|
||||||
run = "plugin mount";
|
|
||||||
desc = "Manage mounting disks";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
161
modules/cross-platform/home-manager/yazi.nix
Normal file
161
modules/cross-platform/home-manager/yazi.nix
Normal file
|
|
@ -0,0 +1,161 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
options = {
|
||||||
|
crony.yazi.enable = lib.mkEnableOption "Enable and setup yazi file manager.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.crony.yazi.enable {
|
||||||
|
# Install and setup yazi
|
||||||
|
programs.yazi = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
shellWrapperName = "y";
|
||||||
|
settings = {
|
||||||
|
mgr = {
|
||||||
|
ratio = [0 4 4];
|
||||||
|
sort_by = "natural";
|
||||||
|
show_hidden = true;
|
||||||
|
show_symlink = false;
|
||||||
|
};
|
||||||
|
plugin = {
|
||||||
|
prepend_fetchers = [
|
||||||
|
{
|
||||||
|
id = "git";
|
||||||
|
name = "*";
|
||||||
|
run = "git";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
id = "git";
|
||||||
|
name = "*/";
|
||||||
|
run = "git";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
prepend_previewers = [
|
||||||
|
# Archive previewer
|
||||||
|
{
|
||||||
|
mime = "application/*zip";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-tar";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-bzip2";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-7z-compressed";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-rar";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/vnd.rar";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-xz";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/xz";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/x-zstd";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/zstd";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mime = "application/java-archive";
|
||||||
|
run = "ouch";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
opener = {
|
||||||
|
extract = [
|
||||||
|
{
|
||||||
|
run = "ouch -d -y \"$@\"";
|
||||||
|
desc = "Extract here with ouch";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
plugins = {
|
||||||
|
full-border = pkgs.yaziPlugins.full-border;
|
||||||
|
smart-enter = pkgs.yaziPlugins.smart-enter;
|
||||||
|
smart-tab = ./yazi/smart-tab;
|
||||||
|
folder-rules = ./yazi/folder-rules;
|
||||||
|
toggle-pane = pkgs.yaziPlugins.toggle-pane;
|
||||||
|
parent-arrow = ./yazi/parent-arrow;
|
||||||
|
chmod = pkgs.yaziPlugins.chmod;
|
||||||
|
ouch = pkgs.yaziPlugins.ouch;
|
||||||
|
git = pkgs.yaziPlugins.git;
|
||||||
|
mount = pkgs.yaziPlugins.mount;
|
||||||
|
};
|
||||||
|
initLua = ./yazi/init.lua;
|
||||||
|
keymap = {
|
||||||
|
mgr.prepend_keymap = [
|
||||||
|
{
|
||||||
|
on = "l";
|
||||||
|
run = "plugin smart-enter";
|
||||||
|
desc = "Enter the child directory, or open the file";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "t";
|
||||||
|
run = "plugin smart-tab";
|
||||||
|
desc = "Create a tab and enter the howered directory";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "<C-w>";
|
||||||
|
for = "linux";
|
||||||
|
run = "shell -- hyprctl hyprpaper reload , \"$0\"";
|
||||||
|
desc = "Set howered file as wallpaper";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = [" " "p"];
|
||||||
|
run = "plugin toggle-pane min-preview";
|
||||||
|
desc = "Show or hide the preview pane";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "K";
|
||||||
|
run = "plugin parent-arrow -1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "J";
|
||||||
|
run = "plugin parent-arrow 1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = ["g" "r"];
|
||||||
|
run = "shell -- ya emit cd \"$(git rev-parse --show-toplevel)\"";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = ["c" "m"];
|
||||||
|
run = "plugin chmod";
|
||||||
|
desc = "Chmod on selected files";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "C";
|
||||||
|
run = "plugin ouch tar.gz";
|
||||||
|
desc = "Compress with ouch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
on = "M";
|
||||||
|
run = "plugin mount";
|
||||||
|
desc = "Manage mounting disks";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue