From 6c99de41a31f0eac59306ea4f2c7d6256170193d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Mon, 27 Jul 2026 10:07:55 +0200 Subject: [PATCH] Inline the eza theme as programs.eza.theme * The option serializes a Nix value to the same theme.yml; the raw file bought nothing since eza only reads it. Verified identical: both versions yq-normalized to equal JSON. * Duskfox hex codes collapse into named palette bindings instead of repeating per entry. --- config/eza/theme.yml | 87 ---------------------------------- modules/eza.nix | 109 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 89 deletions(-) delete mode 100644 config/eza/theme.yml diff --git a/config/eza/theme.yml b/config/eza/theme.yml deleted file mode 100644 index 399f440..0000000 --- a/config/eza/theme.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Duskfox palette, to match ghostty/nvim. -# fg #e0def4 fg3 #6e6a86 comment #817c9c -# red #eb6f92 yellow #f6c177 orange #ea9a97 -# blue #569fba cyan #9ccfd8 magenta #c4a7e7 -colourful: true - -filekinds: - normal: { foreground: "#e0def4" } - directory: { foreground: "#9ccfd8" } - symlink: { foreground: "#c4a7e7" } - pipe: { foreground: "#817c9c" } - block_device: { foreground: "#f6c177" } - char_device: { foreground: "#f6c177" } - socket: { foreground: "#eb6f92" } - special: { foreground: "#f6c177" } - executable: { foreground: "#ea9a97" } - mount_point: { foreground: "#9ccfd8" } - -perms: - user_read: { foreground: "#f6c177" } - user_write: { foreground: "#eb6f92" } - user_execute_file: { foreground: "#569fba" } - user_execute_other: { foreground: "#569fba" } - group_read: { foreground: "#f6c177" } - group_write: { foreground: "#eb6f92" } - group_execute: { foreground: "#569fba" } - other_read: { foreground: "#f6c177" } - other_write: { foreground: "#eb6f92" } - other_execute: { foreground: "#569fba" } - special_user_file: { foreground: "#c4a7e7" } - special_other: { foreground: "#c4a7e7" } - attribute: { foreground: "#6e6a86" } - -size: - major: { foreground: "#e0def4" } - minor: { foreground: "#817c9c" } - number_byte: { foreground: "#e0def4" } - number_kilo: { foreground: "#e0def4" } - number_mega: { foreground: "#e0def4" } - number_giga: { foreground: "#e0def4" } - number_huge: { foreground: "#e0def4" } - unit_byte: { foreground: "#817c9c" } - unit_kilo: { foreground: "#817c9c" } - unit_mega: { foreground: "#817c9c" } - unit_giga: { foreground: "#817c9c" } - unit_huge: { foreground: "#817c9c" } - -users: - user_you: { foreground: "#e0def4" } - user_other: { foreground: "#817c9c" } - user_root: { foreground: "#eb6f92" } - -links: - normal: { foreground: "#9ccfd8" } - multi_link_file: { foreground: "#f6c177" } - -git: - new: { foreground: "#9ccfd8" } - modified: { foreground: "#f6c177" } - deleted: { foreground: "#eb6f92" } - renamed: { foreground: "#c4a7e7" } - typechange: { foreground: "#ea9a97" } - ignored: { foreground: "#6e6a86" } - conflicted: { foreground: "#eb6f92" } - -file_type: - image: { foreground: "#f6c177" } - video: { foreground: "#eb6f92" } - music: { foreground: "#9ccfd8" } - lossless: { foreground: "#9ccfd8" } - crypto: { foreground: "#6e6a86" } - document: { foreground: "#e0def4" } - compressed: { foreground: "#c4a7e7" } - temp: { foreground: "#6e6a86" } - compiled: { foreground: "#817c9c" } - build: { foreground: "#817c9c" } - source: { foreground: "#569fba" } - -punctuation: { foreground: "#6e6a86" } -date: { foreground: "#569fba" } -inode: { foreground: "#6e6a86" } -blocks: { foreground: "#6e6a86" } -header: { foreground: "#817c9c", is_bold: true } -symlink_path: { foreground: "#c4a7e7" } -control_char: { foreground: "#eb6f92" } -broken_symlink: { foreground: "#eb6f92" } -broken_path_overlay: { foreground: "#eb6f92" } diff --git a/modules/eza.nix b/modules/eza.nix index 782a689..51bd14c 100644 --- a/modules/eza.nix +++ b/modules/eza.nix @@ -1,11 +1,116 @@ { ... }: +let + # Duskfox palette, to match ghostty/nvim. + fg = "#e0def4"; + fg3 = "#6e6a86"; + comment = "#817c9c"; + red = "#eb6f92"; + yellow = "#f6c177"; + orange = "#ea9a97"; + blue = "#569fba"; + cyan = "#9ccfd8"; + magenta = "#c4a7e7"; + c = colour: { foreground = colour; }; +in { programs.eza.enable = true; # Preserve the long-form tree alias; Home Manager provides ls/ll/la/lt/lla. programs.fish.shellAliases.tree = "eza --tree"; - # Colours come from config/eza/theme.yml (Duskfox). - xdg.configFile."eza/theme.yml".source = ../config/eza/theme.yml; + programs.eza.theme = { + colourful = true; + + filekinds = { + normal = c fg; + directory = c cyan; + symlink = c magenta; + pipe = c comment; + block_device = c yellow; + char_device = c yellow; + socket = c red; + special = c yellow; + executable = c orange; + mount_point = c cyan; + }; + + perms = { + user_read = c yellow; + user_write = c red; + user_execute_file = c blue; + user_execute_other = c blue; + group_read = c yellow; + group_write = c red; + group_execute = c blue; + other_read = c yellow; + other_write = c red; + other_execute = c blue; + special_user_file = c magenta; + special_other = c magenta; + attribute = c fg3; + }; + + size = { + major = c fg; + minor = c comment; + number_byte = c fg; + number_kilo = c fg; + number_mega = c fg; + number_giga = c fg; + number_huge = c fg; + unit_byte = c comment; + unit_kilo = c comment; + unit_mega = c comment; + unit_giga = c comment; + unit_huge = c comment; + }; + + users = { + user_you = c fg; + user_other = c comment; + user_root = c red; + }; + + links = { + normal = c cyan; + multi_link_file = c yellow; + }; + + git = { + new = c cyan; + modified = c yellow; + deleted = c red; + renamed = c magenta; + typechange = c orange; + ignored = c fg3; + conflicted = c red; + }; + + file_type = { + image = c yellow; + video = c red; + music = c cyan; + lossless = c cyan; + crypto = c fg3; + document = c fg; + compressed = c magenta; + temp = c fg3; + compiled = c comment; + build = c comment; + source = c blue; + }; + + punctuation = c fg3; + date = c blue; + inode = c fg3; + blocks = c fg3; + header = (c comment) // { + is_bold = true; + }; + symlink_path = c magenta; + control_char = c red; + broken_symlink = c red; + broken_path_overlay = c red; + }; } -- 2.51.2