nixdots/home/programs/terminal/file-managers/xplr/default.nix

52 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2024-04-04 23:22:59 +00:00
{
pkgs,
lib,
...
2024-04-04 23:33:23 +00:00
}: {
home.packages = with pkgs; [
xplr
];
xdg.configFile."xplr/init.lua".text = let
# get plugin derivations from plugins.nix so that this file remains clean
inherit (import ./plugins.nix pkgs) wl-clipboard-plugin nuke-plugin;
in ''
version = '${pkgs.xplr.version}'
package.path =
"${wl-clipboard-plugin}/init.lua;" ..
"${nuke-plugin}/init.lua;" ..
package.path
require("wl-clipboard").setup{
copy_command = "wl-copy -t text/uri-list",
paste_command = "wl-paste",
keep_selection = true,
}
require("nuke").setup{
pager = "less -R",
open = {
run_executables = true, -- default: false
custom = {
{extension = "jpg", command = "imv {}"},
{extension = "pdf", command = "zathura {}"},
{mime_regex = "^video/.*", command = "mpv {}"},
{mime_regex = ".*", command = "xdg-open {}"}
}
},
2024-04-04 23:22:59 +00:00
2024-04-04 23:33:23 +00:00
view = {
show_line_numbers = true, -- default: false
},
2024-04-04 23:22:59 +00:00
2024-04-04 23:33:23 +00:00
smart_view = {
custom = {
{extension = "so", command = "ldd -r {} | less"},
2024-04-04 23:22:59 +00:00
},
}
2024-04-04 23:33:23 +00:00
}
'';
2024-04-04 23:22:59 +00:00
}