1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 04:09:47 +01:00
home-manager/modules/programs/exa.nix

41 lines
896 B
Nix
Raw Normal View History

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