system/home/progs/exa.nix

34 lines
697 B
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.exa;
2022-09-05 09:57:31 +03:00
zsh = config.shell.zsh;
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";
};
};
2022-08-29 15:40:41 +03:00
config = mkIf cfg.enable {
home.packages = [ exaPackage ];
2022-09-05 09:57:31 +03:00
programs.zsh.shellAliases = mkIf zsh.enable rec {
ls = "${bin} --oneline";
la = "${ls} --all";
lt = "${bin} --tree --level=3";
ll = "${bin} --long --header";
lla = "${ll} --all";
};
};
}