less: allow customization
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
This commit is contained in:
parent
7c320a5325
commit
f23073f1da
8 changed files with 78 additions and 0 deletions
32
modules/programs/less.nix
Normal file
32
modules/programs/less.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.less;
|
||||
in {
|
||||
meta.maintainers = [ maintainers.pamplemousse ];
|
||||
|
||||
options = {
|
||||
programs.less = {
|
||||
enable = mkEnableOption "less, opposite of more";
|
||||
|
||||
keys = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
example = ''
|
||||
s back-line
|
||||
t forw-line
|
||||
'';
|
||||
description = ''
|
||||
Extra configuration for <command>less</command> written to
|
||||
<filename>$HOME/.lesskey</filename>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.less ];
|
||||
home.file.".lesskey".text = cfg.keys;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue