2022-04-27 01:17:51 +03:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.progs.exa;
|
2022-09-05 09:57:31 +03:00
|
|
|
zsh = config.shell.zsh;
|
2022-09-05 00:58:47 +03:00
|
|
|
|
2022-09-20 08:48:58 +03:00
|
|
|
exaPackage = pkgs.exa.override { gitSupport = false; };
|
2022-09-05 00:58:47 +03:00
|
|
|
defaultArgs = "--icons --classify";
|
|
|
|
bin = "${exaPackage}/bin/exa ${defaultArgs}";
|
2022-04-27 01:17:51 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.progs.exa = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Add and configure exa, a modern replacement for ls";
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 15:40:41 +03:00
|
|
|
|
2022-04-27 01:17:51 +03:00
|
|
|
config = mkIf cfg.enable {
|
2022-09-15 10:31:32 +03:00
|
|
|
programs.exa = {
|
|
|
|
enable = true;
|
|
|
|
package = exaPackage;
|
|
|
|
};
|
2022-09-05 00:58:47 +03:00
|
|
|
|
2022-09-05 09:57:31 +03:00
|
|
|
programs.zsh.shellAliases = mkIf zsh.enable rec {
|
2022-09-05 00:58:47 +03:00
|
|
|
ls = "${bin} --oneline";
|
|
|
|
la = "${ls} --all";
|
|
|
|
lt = "${bin} --tree --level=3";
|
|
|
|
ll = "${bin} --long --header";
|
|
|
|
lla = "${ll} --all";
|
2022-04-27 01:17:51 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|