Skip to content

Commit bf252c3

Browse files
committed
chawan: init module
This is a super cool TUI browser capable of CSS and other cool stuff. Reminiscent of ELinks but modern and better. More info here: https://sr.ht/~bptato/chawan/
1 parent c15ab0c commit bf252c3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

modules/programs/chawan.nix

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{ config, lib, pkgs }:
2+
let
3+
cfg = config.programs.chawan;
4+
tomlFormat = (pkgs.formats.toml { });
5+
tomlType = tomlFormat.type;
6+
toConf = tomlFormat.generate "config.toml";
7+
in {
8+
meta.maintainers = [ lib.maintainers.noodlez1232 ];
9+
options.programs.chawan = {
10+
enable = lib.mkEnableOption "chawan, A TUI web browser";
11+
package = lib.mkPackageOption pkgs "chawan" { nullable = true; };
12+
settings = lib.mkOption {
13+
default = { };
14+
type = tomlType;
15+
description = ''
16+
Configuration options for chawan.
17+
18+
See {manpage}`cha-config(5)`
19+
'';
20+
example = lib.literalExpression ''
21+
{
22+
buffer = {
23+
images = true;
24+
autofocus = true;
25+
};
26+
pager."C-k" = "() => pager.load('https://duckduckgo.com/?=')";
27+
}
28+
'';
29+
};
30+
};
31+
32+
config = lib.mkIf cfg.enable {
33+
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
34+
xdg.configFile = lib.mkIf (cfg.settings != { }) {
35+
"chawan/config.toml" = { source = toConf cfg.settings; };
36+
};
37+
};
38+
39+
}

0 commit comments

Comments
 (0)