32 lines
684 B
Nix
32 lines
684 B
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.progs.exa;
|
|
|
|
exaPackage = pkgs.exa-minimal;
|
|
defaultArgs = "--icons --classify";
|
|
bin = "${exaPackage}/bin/exa ${defaultArgs}";
|
|
in
|
|
{
|
|
options.progs.exa = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "Add and configure exa, a modern replacement for ls";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ exaPackage ];
|
|
|
|
programs.zsh.shellAliases = mkIf config.shell.zsh.enable rec {
|
|
ls = "${bin} --oneline";
|
|
la = "${ls} --all";
|
|
lt = "${bin} --tree --level=3";
|
|
ll = "${bin} --long --header";
|
|
lla = "${ll} --all";
|
|
};
|
|
};
|
|
}
|