1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00
home-manager/modules/programs/pls.nix

37 lines
779 B
Nix
Raw Normal View History

2022-09-30 18:53:39 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.pls;
aliases = {
ls = "${cfg.package}/bin/pls";
ll =
"${cfg.package}/bin/pls -d perms -d user -d group -d size -d mtime -d git";
};
in {
meta.maintainers = [ hm.maintainers.kalhauge ];
options.programs.pls = {
enable =
mkEnableOption "pls, a modern replacement for <command>ls</command>";
package = mkPackageOption pkgs "pls" { };
enableAliases = mkEnableOption "recommended pls aliases";
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
};
}