2021-04-09 16:08:06 +02: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 19:24:46 +01:00
|
|
|
meta.maintainers = [ hm.maintainers.kalhauge ];
|
2021-04-09 16:08:06 +02:00
|
|
|
|
|
|
|
options.programs.exa = {
|
|
|
|
enable =
|
|
|
|
mkEnableOption "exa, a modern replacement for <command>ls</command>";
|
2022-09-13 23:26:28 +02:00
|
|
|
|
2021-04-09 16:08:06 +02:00
|
|
|
enableAliases = mkEnableOption "recommended exa aliases";
|
2022-09-13 23:26:28 +02:00
|
|
|
|
|
|
|
package = mkPackageOption pkgs "exa" { };
|
2021-04-09 16:08:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-09-13 23:26:28 +02:00
|
|
|
home.packages = [ cfg.package ];
|
2021-04-09 16:08:06 +02: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 19:15:45 +01:00
|
|
|
programs.ion.shellAliases = mkIf cfg.enableAliases aliases;
|
2021-04-09 16:08:06 +02:00
|
|
|
};
|
|
|
|
}
|