1

Compare commits

...

4 Commits

5 changed files with 56 additions and 8 deletions

View File

@ -246,12 +246,8 @@ rec {
defaultApplications = nixosConfig.xdg.mime.defaultApplications; defaultApplications = nixosConfig.xdg.mime.defaultApplications;
}; };
# TODO: What about desktop portals? They're configured in system config, do I need to do sth here?
portal = { portal = {
enable = nixosConfig.xdg.portal.enable; inherit (nixosConfig.xdg.portal) enable xdgOpenUsePortal config extraPortals;
xdgOpenUsePortal = nixosConfig.xdg.portal.xdgOpenUsePortal;
config.common.default = nixosConfig.xdg.portal.config.common.default;
extraPortals = nixosConfig.xdg.portal.extraPortals;
}; };
}; };
@ -300,6 +296,15 @@ rec {
".ssh/id_ed25519.pub".text = "${sshPublicKey}"; ".ssh/id_ed25519.pub".text = "${sshPublicKey}";
".ssh/allowed_signers".text = "* ${sshPublicKey}"; ".ssh/allowed_signers".text = "* ${sshPublicKey}";
".config/xdg-desktop-portal-termfilechooser/config".text = ''
[filechooser]
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
default_dir=$HOME
env=TERMCMD=kitty --class=file_chooser
open_mode = suggested
save_mode = last
'';
}; };
# Here, custom scripts can be run when activating a HM generation. # Here, custom scripts can be run when activating a HM generation.

View File

@ -300,6 +300,12 @@ in {
"toolkit.telemetry.coverage.opt-out" = true; "toolkit.telemetry.coverage.opt-out" = true;
"widget.use-xdg-desktop-portal" = true; "widget.use-xdg-desktop-portal" = true;
"widget.use-xdg-desktop-portal.file-picker" = 1; # 1: always, 2: auto
"widget.use-xdg-desktop-portal.location" = 2;
"widget.use-xdg-desktop-portal.mime-handler" = 2;
"widget.use-xdg-desktop-portal.native-messaging" = 0;
"widget.use-xdg-desktop-portal.open-uri" = 2;
"widget.use-xdg-desktop-portal.settings" = 2;
}) })
]; ];
}; };

View File

@ -1477,7 +1477,7 @@ in {
explorer = { explorer = {
enabled = true; enabled = true;
replace_netrw = true; replace_netrw = false; # Use yazi for that
}; };
notifier = { notifier = {
@ -1919,6 +1919,28 @@ in {
]; ];
config = mkDefaultConfig name; config = mkDefaultConfig name;
}; };
yazi = rec {
name = "yazi";
pkg = pkgs.vimPlugins.yazi-nvim;
lazy = true;
event = ["VeryLazy"];
dependencies = [_plenary];
config = mkDefaultConfig name;
opts = {
open_for_directories = true;
highlight_hovered_buffers_in_same_directory = false;
integrations = {
grep_in_directory.__raw = ''
function(directory)
Snacks.picker.grep({dirs={directory}})
end
'';
picker_add_copy_relative_path_action = "snacks.picker";
};
};
};
in [ in [
autopairs # Automatic closing brackets/parens # NOTE: For now replaced by blink autopairs # Automatic closing brackets/parens # NOTE: For now replaced by blink
@ -1991,6 +2013,7 @@ in {
window-picker # Jump to window without multiple <leader-hjkl> window-picker # Jump to window without multiple <leader-hjkl>
winshift # Move windows around winshift # Move windows around
yanky # Clipboard history yanky # Clipboard history
yazi
]; ];
}; };
}; };

View File

@ -388,6 +388,12 @@ _: let
action = "<cmd>:set wrap!<cr>"; action = "<cmd>:set wrap!<cr>";
options.desc = "Toggle Word Wrap"; options.desc = "Toggle Word Wrap";
} }
{
mode = "n";
key = "<leader>y";
action = "<cmd>Yazi<cr>";
options.desc = "Toggle Yazi";
}
]; ];
leader-file = [ leader-file = [

View File

@ -307,14 +307,22 @@ with mylib.networking; {
portal = { portal = {
enable = true; enable = true;
xdgOpenUsePortal = false; xdgOpenUsePortal = false;
config.common.default = ["*"]; # https://discourse.nixos.org/t/clicked-links-in-desktop-apps-not-opening-browers/29114/26
wlr.enable = false; # Hyprland has its own portal automatically enabled... wlr.enable = false; # Hyprland has its own portal automatically enabled...
config = {
common.default = ["*"]; # https://discourse.nixos.org/t/clicked-links-in-desktop-apps-not-opening-browers/29114/26
common."org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
hyprland.default = ["hyprland"];
hyprland."org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"];
};
extraPortals = with pkgs; [ extraPortals = with pkgs; [
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
xdg-desktop-portal-termfilechooser # Filepicker using yazi
# xdg-desktop-portal-kde # xdg-desktop-portal-kde
# xdg-desktop-portal-hyprland # Already enabled by hyprland system module # xdg-desktop-portal-hyprland # Already enabled by hyprland system module
# xdg-desktop-portal-termfilechooser # Filepicker using nnn
]; ];
}; };
}; };