From c6cbdebfe2f021bc61e6a4336c6b6032d0583311 Mon Sep 17 00:00:00 2001 From: wi11-holdsworth <83637728+wi11-holdsworth@users.noreply.github.com> Date: Thu, 7 Aug 2025 11:48:22 +1000 Subject: [PATCH] configure bat, eza and yazi in home-manager --- modules/home-manager/default.nix | 3 + modules/home-manager/features/bat.nix | 23 ++ modules/home-manager/features/eza.nix | 293 +++++++++++++++++++++++++ modules/home-manager/features/yazi.nix | 35 +++ 4 files changed, 354 insertions(+) create mode 100644 modules/home-manager/features/bat.nix create mode 100644 modules/home-manager/features/eza.nix create mode 100644 modules/home-manager/features/yazi.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 47761b2..fa41e28 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -7,8 +7,11 @@ in { imports = (featureBundler ./bundles) ++ (featureBundler ./features); + bat.enable = lib.mkDefault true; + eza.enable = lib.mkDefault true; gh.enable = lib.mkDefault true; git.enable = lib.mkDefault true; nushell.enable = lib.mkDefault true; + yazi.enable = lib.mkDefault true; zoxide.enable = lib.mkDefault true; } diff --git a/modules/home-manager/features/bat.nix b/modules/home-manager/features/bat.nix new file mode 100644 index 0000000..d24c674 --- /dev/null +++ b/modules/home-manager/features/bat.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + lib, + ... +}: +let + feature = "bat"; +in +{ + config = lib.mkIf config.${feature}.enable { + programs.bat = { + enable = true; + config = { + theme = "Dracula"; + }; + }; + }; + + imports = [ ]; + + options.${feature}.enable = lib.mkEnableOption "enables ${feature}"; +} diff --git a/modules/home-manager/features/eza.nix b/modules/home-manager/features/eza.nix new file mode 100644 index 0000000..733bb88 --- /dev/null +++ b/modules/home-manager/features/eza.nix @@ -0,0 +1,293 @@ +{ config, lib, ... }: +let + feature = "eza"; +in +{ + config = lib.mkIf config.${feature}.enable { + programs.eza = { + enable = true; + extraOptions = [ + "--long" + "--header" + "--group-directories-first" + ]; + git = true; + icons = "always"; + theme = { + colourful = true; + + filekinds = { + normal = { + foreground = "#BAC2DE"; + }; + directory = { + foreground = "#89B4FA"; + }; + symlink = { + foreground = "#89DCEB"; + }; + pipe = { + foreground = "#7F849C"; + }; + block_device = { + foreground = "#EBA0AC"; + }; + char_device = { + foreground = "#EBA0AC"; + }; + socket = { + foreground = "#585B70"; + }; + special = { + foreground = "#CBA6F7"; + }; + executable = { + foreground = "#A6E3A1"; + }; + mount_point = { + foreground = "#74C7EC"; + }; + }; + + perms = { + user_read = { + foreground = "#CDD6F4"; + }; + user_write = { + foreground = "#F9E2AF"; + }; + user_execute_file = { + foreground = "#A6E3A1"; + }; + user_execute_other = { + foreground = "#A6E3A1"; + }; + group_read = { + foreground = "#BAC2DE"; + }; + group_write = { + foreground = "#F9E2AF"; + }; + group_execute = { + foreground = "#A6E3A1"; + }; + other_read = { + foreground = "#A6ADC8"; + }; + other_write = { + foreground = "#F9E2AF"; + }; + other_execute = { + foreground = "#A6E3A1"; + }; + special_user_file = { + foreground = "#CBA6F7"; + }; + special_other = { + foreground = "#585B70"; + }; + attribute = { + foreground = "#A6ADC8"; + }; + }; + + size = { + major = { + foreground = "#A6ADC8"; + }; + minor = { + foreground = "#89DCEB"; + }; + number_byte = { + foreground = "#CDD6F4"; + }; + number_kilo = { + foreground = "#BAC2DE"; + }; + number_mega = { + foreground = "#89B4FA"; + }; + number_giga = { + foreground = "#CBA6F7"; + }; + number_huge = { + foreground = "#CBA6F7"; + }; + unit_byte = { + foreground = "#A6ADC8"; + }; + unit_kilo = { + foreground = "#89B4FA"; + }; + unit_mega = { + foreground = "#CBA6F7"; + }; + unit_giga = { + foreground = "#CBA6F7"; + }; + unit_huge = { + foreground = "#74C7EC"; + }; + }; + + users = { + user_you = { + foreground = "#CDD6F4"; + }; + user_root = { + foreground = "#F38BA8"; + }; + user_other = { + foreground = "#CBA6F7"; + }; + group_yours = { + foreground = "#BAC2DE"; + }; + group_other = { + foreground = "#7F849C"; + }; + group_root = { + foreground = "#F38BA8"; + }; + + }; + links = { + normal = { + foreground = "#89DCEB"; + }; + multi_link_file = { + foreground = "#74C7EC"; + }; + }; + + git = { + new = { + foreground = "#A6E3A1"; + }; + modified = { + foreground = "#F9E2AF"; + }; + deleted = { + foreground = "#F38BA8"; + }; + renamed = { + foreground = "#94E2D5"; + }; + typechange = { + foreground = "#F5C2E7"; + }; + ignored = { + foreground = "#7F849C"; + }; + conflicted = { + foreground = "#EBA0AC"; + }; + }; + git_repo = { + branch_main = { + foreground = "#CDD6F4"; + }; + branch_other = { + foreground = "#CBA6F7"; + }; + git_clean = { + foreground = "#A6E3A1"; + }; + git_dirty = { + foreground = "#F38BA8"; + }; + }; + security_context = { + colon = { + foreground = "#7F849C"; + }; + user = { + foreground = "#BAC2DE"; + }; + role = { + foreground = "#CBA6F7"; + }; + typ = { + foreground = "#585B70"; + }; + range = { + foreground = "#CBA6F7"; + }; + }; + file_type = { + image = { + foreground = "#F9E2AF"; + }; + video = { + foreground = "#F38BA8"; + }; + music = { + foreground = "#A6E3A1"; + }; + lossless = { + foreground = "#94E2D5"; + }; + crypto = { + foreground = "#585B70"; + }; + document = { + foreground = "#CDD6F4"; + }; + compressed = { + foreground = "#F5C2E7"; + }; + temp = { + foreground = "#EBA0AC"; + }; + compiled = { + foreground = "#74C7EC"; + }; + build = { + foreground = "#585B70"; + }; + source = { + foreground = "#89B4FA"; + }; + }; + punctuation = { + foreground = "#7F849C"; + }; + date = { + foreground = "#F9E2AF"; + }; + inode = { + foreground = "#A6ADC8"; + }; + blocks = { + foreground = "#9399B2"; + }; + header = { + foreground = "#CDD6F4"; + }; + octal = { + foreground = "#94E2D5"; + }; + flags = { + foreground = "#CBA6F7"; + }; + + symlink_path = { + foreground = "#89DCEB"; + }; + control_char = { + foreground = "#74C7EC"; + }; + broken_symlink = { + foreground = "#F38BA8"; + }; + broken_path_overlay = { + foreground = "#585B70"; + }; + }; + }; + }; + + imports = [ ]; + + options.${feature}.enable = lib.mkEnableOption "enables ${feature}"; +} diff --git a/modules/home-manager/features/yazi.nix b/modules/home-manager/features/yazi.nix new file mode 100644 index 0000000..6121407 --- /dev/null +++ b/modules/home-manager/features/yazi.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +let + feature = "yazi"; +in +{ + config = lib.mkIf config.${feature}.enable { + programs.yazi = { + enable = true; + plugins = { + diff = pkgs.yaziPlugins.diff; + git = pkgs.yaziPlugins.git; + mediainfo = pkgs.yaziPlugins.mediainfo; + mount = pkgs.yaziPlugins.mount; + ouch = pkgs.yaziPlugins.ouch; + relative-motions = pkgs.yaziPlugins.relative-motions; + restore = pkgs.yaziPlugins.restore; + rich-preview = pkgs.yaziPlugins.rich-preview; + starship = pkgs.yaziPlugins.starship; + vcs-files = pkgs.yaziPlugins.vcs-files; + yatline-githead = pkgs.yaziPlugins.yatline-githead; + }; + # flavors = {}; + # themes = {}; + }; + }; + + imports = [ ]; + + options.${feature}.enable = lib.mkEnableOption "enables ${feature}"; +}