2021-04-09 14:08:06 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.exa;
|
|
|
|
|
|
|
|
aliases = {
|
|
|
|
ls = "${pkgs.exa}/bin/exa";
|
|
|
|
ll = "${pkgs.exa}/bin/exa -l";
|
|
|
|
la = "${pkgs.exa}/bin/exa -a";
|
|
|
|
lt = "${pkgs.exa}/bin/exa --tree";
|
|
|
|
lla = "${pkgs.exa}/bin/exa -la";
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2021-12-25 18:24:46 +00:00
|
|
|
meta.maintainers = [ hm.maintainers.kalhauge ];
|
2021-04-09 14:08:06 +00:00
|
|
|
|
|
|
|
options.programs.exa = {
|
|
|
|
enable =
|
|
|
|
mkEnableOption "exa, a modern replacement for <command>ls</command>";
|
2022-09-13 21:26:28 +00:00
|
|
|
|
2021-04-09 14:08:06 +00:00
|
|
|
enableAliases = mkEnableOption "recommended exa aliases";
|
2022-09-13 21:26:28 +00:00
|
|
|
|
|
|
|
package = mkPackageOption pkgs "exa" { };
|
2021-04-09 14:08:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-09-13 21:26:28 +00:00
|
|
|
home.packages = [ cfg.package ];
|
2021-04-09 14:08:06 +00:00
|
|
|
|
|
|
|
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
|
|
|
|
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
|
|
|
|
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
|
2022-01-27 18:15:45 +00:00
|
|
|
programs.ion.shellAliases = mkIf cfg.enableAliases aliases;
|
2021-04-09 14:08:06 +00:00
|
|
|
};
|
|
|
|
}
|