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 {
|
2023-05-14 12:40:31 +02:00
|
|
|
meta.maintainers = [ maintainers.arjan-s ];
|
2022-09-30 18:53:39 +02:00
|
|
|
|
|
|
|
options.programs.pls = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "pls, a modern replacement for {command}`ls`";
|
2022-09-30 18:53:39 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = mkPackageOption pkgs "pls" { };
|
2022-09-30 18:53:39 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
enableAliases = mkEnableOption "recommended pls aliases";
|
2022-09-30 18:53:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
programs.bash.shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
|
2024-09-13 18:36:08 +02:00
|
|
|
programs.fish = mkMerge [
|
|
|
|
(mkIf (!config.programs.fish.preferAbbrs) {
|
|
|
|
shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
})
|
|
|
|
|
|
|
|
(mkIf config.programs.fish.preferAbbrs {
|
|
|
|
shellAbbrs = mkIf cfg.enableAliases aliases;
|
|
|
|
})
|
|
|
|
];
|
2022-09-30 18:53:39 +02:00
|
|
|
|
|
|
|
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
|
|
|
};
|
|
|
|
}
|