broot: expose modal option (#2300)

* broot: expose modal option

* broot: add basic test

* Use `mkEnableOption`
This commit is contained in:
Seth Etter 2021-08-31 11:52:20 -05:00 committed by GitHub
parent 61ca2fc1c0
commit 21a2ff4496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 0 deletions

View file

@ -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 = [

View file

@ -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

View 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]
''
}
'';
};
}

View file

@ -0,0 +1 @@
{ broot = ./broot.nix; }