lesspipe: allow configuring package
This commit is contained in:
parent
35b98d20ca
commit
19398e505a
4 changed files with 21 additions and 3 deletions
|
@ -2,18 +2,24 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.lesspipe;
|
||||||
|
|
||||||
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
programs.lesspipe = {
|
programs.lesspipe = {
|
||||||
enable = mkEnableOption "lesspipe preprocessor for less";
|
enable = mkEnableOption "lesspipe preprocessor for less";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "lesspipe" { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.programs.lesspipe.enable {
|
config = mkIf cfg.enable {
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
LESSOPEN = "|${pkgs.lesspipe}/bin/lesspipe.sh %s";
|
LESSOPEN = "|${cfg.package}/bin/lesspipe.sh %s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ in import nmtSrc {
|
||||||
./modules/programs/kubecolor
|
./modules/programs/kubecolor
|
||||||
./modules/programs/ledger
|
./modules/programs/ledger
|
||||||
./modules/programs/less
|
./modules/programs/less
|
||||||
|
./modules/programs/lesspipe
|
||||||
./modules/programs/lf
|
./modules/programs/lf
|
||||||
./modules/programs/lsd
|
./modules/programs/lsd
|
||||||
./modules/programs/lieer
|
./modules/programs/lieer
|
||||||
|
|
1
tests/modules/programs/lesspipe/default.nix
Normal file
1
tests/modules/programs/lesspipe/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ lesspipe = ./lesspipe.nix; }
|
10
tests/modules/programs/lesspipe/lesspipe.nix
Normal file
10
tests/modules/programs/lesspipe/lesspipe.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
programs.lesspipe.enable = true;
|
||||||
|
|
||||||
|
test.stubs.lesspipe = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
|
||||||
|
'export LESSOPEN="|@lesspipe@/bin/lesspipe.sh %s"'
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue