summaryrefslogtreecommitdiff
path: root/modules/packages/eza.nix
blob: ba79c6755e95796974e7ac6f59a0bf8abe110233 (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
{inputs, ...}: {
  perSystem = {pkgs, ...}: let
    eza-theme = pkgs.fetchurl {
      url = "https://raw.githubusercontent.com/eza-community/eza-themes/main/themes/gruvbox-dark.yml";
      hash = "sha256-6vxzSQw2mq8oh0Es1LYmbbavuN0LFOg4Ch6u1G9dv4w=";
    };

    eza-config-dir = pkgs.runCommand "eza-config-dir" {} ''
      mkdir -p $out
      cp ${eza-theme} $out/theme.yml
    '';
  in {
    packages.eza = inputs.wrappers.lib.wrapPackage {
      inherit pkgs;
      package = pkgs.eza;
      flags = {
        "--git" = true;
        "--icons" = "auto";
        "--color" = "always";
        "--octal-permissions" = true;
        "--group-directories-first" = true;
        "--header" = true;
        "--total-size" = true;
        "--time-style" = "long-iso";
        "--no-permissions" = true;
        "--long" = true;
      };
      env = {
        EZA_CONFIG_DIR = "${eza-config-dir}";
      };
    };
  };
}