mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
broot: expose modal option (#2300)
* broot: expose modal option * broot: add basic test * Use `mkEnableOption`
This commit is contained in:
parent
61ca2fc1c0
commit
21a2ff4496
4 changed files with 48 additions and 0 deletions
|
@ -11,6 +11,7 @@ let
|
|||
brootConf = {
|
||||
verbs = cfg.verbs;
|
||||
skin = cfg.skin;
|
||||
modal = cfg.modal;
|
||||
};
|
||||
|
||||
in {
|
||||
|
@ -43,6 +44,8 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
modal = mkEnableOption "modal (vim) mode";
|
||||
|
||||
verbs = mkOption {
|
||||
type = with types; listOf (attrsOf (either bool str));
|
||||
default = [
|
||||
|
|
|
@ -46,6 +46,7 @@ import nmt {
|
|||
./modules/programs/autojump
|
||||
./modules/programs/bash
|
||||
./modules/programs/bat
|
||||
./modules/programs/broot
|
||||
./modules/programs/browserpass
|
||||
./modules/programs/dircolors
|
||||
./modules/programs/direnv
|
||||
|
|
43
tests/modules/programs/broot/broot.nix
Normal file
43
tests/modules/programs/broot/broot.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.broot = {
|
||||
enable = true;
|
||||
modal = true;
|
||||
};
|
||||
|
||||
nixpkgs.overlays =
|
||||
[ (self: super: { broot = pkgs.writeScriptBin "dummy" ""; }) ];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/broot/conf.toml
|
||||
assertFileContent home-files/.config/broot/conf.toml ${
|
||||
pkgs.writeText "broot.expected" ''
|
||||
modal = true
|
||||
|
||||
[[verbs]]
|
||||
execution = ":parent"
|
||||
invocation = "p"
|
||||
|
||||
[[verbs]]
|
||||
execution = "$EDITOR {file}"
|
||||
invocation = "edit"
|
||||
shortcut = "e"
|
||||
|
||||
[[verbs]]
|
||||
execution = "$EDITOR {directory}/{subpath}"
|
||||
invocation = "create {subpath}"
|
||||
|
||||
[[verbs]]
|
||||
execution = "less {file}"
|
||||
invocation = "view"
|
||||
|
||||
[skin]
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
1
tests/modules/programs/broot/default.nix
Normal file
1
tests/modules/programs/broot/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ broot = ./broot.nix; }
|
Loading…
Reference in a new issue