2023-01-10 09:35:00 +00: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 {
|
2023-08-08 10:19:01 +00:00
|
|
|
meta.maintainers = [ maintainers.arjan-s ];
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
options.programs.pls = {
|
2023-08-08 10:19:01 +00:00
|
|
|
enable = mkEnableOption "pls, a modern replacement for {command}`ls`";
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|