2.home-manager/modules/programs/less/default.nix
Austin Horstman 4fca600cb1 treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically
importing modules following a specific convention.

Co-authored-by: awwpotato <awwpotato@voidq.com>
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

39 lines
791 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.less;
in
{
meta.maintainers = [ lib.maintainers.pamplemousse ];
options = {
programs.less = {
enable = lib.mkEnableOption "less, opposite of more";
package = lib.mkPackageOption pkgs "less" { nullable = true; };
keys = lib.mkOption {
type = lib.types.lines;
default = "";
example = ''
s back-line
t forw-line
'';
description = ''
Extra configuration for {command}`less` written to
{file}`$XDG_CONFIG_HOME/lesskey`.
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."lesskey".text = cfg.keys;
};
}