blob: 8d59446e288636f5c69759e184d85da9cdc826c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# Terminal file manager with native previews
{ config, lib, ... }:
{
imports = [
./theme.nix
./assertions.nix
];
options.file-management.yazi = {
enable = lib.mkEnableOption "Enables yazi.";
package = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = config.programs.yazi.finalPackage;
defaultText = lib.literalExpression "config.programs.yazi.finalPackage";
description = "The yazi package to use. Defaults to the wrapped finalPackage from programs.yazi.";
};
};
config = lib.mkIf config.file-management.yazi.enable {
programs.yazi = {
enable = true;
shellWrapperName = "yy";
enableZshIntegration = config.terminal.zsh.enable;
settings = {
mgr = {
show_hidden = true;
};
};
};
home.file.".local/share/icons/hicolor/scalable/apps/yazi.png" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.file-management.yazi.package}/share/pixmaps/yazi.png";
};
xdg.desktopEntries."yazi" = {
name = "Yazi";
exec = "${lib.getExe config.terminal.kitty.package} --class yazi -e ${lib.getExe config.file-management.yazi.package}";
icon = "yazi";
categories = [ "Utility" ];
comment = "Terminal file manager";
terminal = false;
type = "Application";
};
xdg.mimeApps.defaultApplications = {
"inode/directory" = "yazi.desktop";
};
home.sessionVariables = {
TERMCMD = lib.mkIf config.terminal.kitty.enable "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi'";
};
};
}
|