1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-21 17:59:39 +01:00
home-manager/modules/programs/chawan.nix
Nathaniel Barragan cb65c81403
chawan: init module (#6768)
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/
2025-04-16 14:41:17 -05:00

47 lines
1.1 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.chawan;
tomlFormat = (pkgs.formats.toml { });
tomlType = tomlFormat.type;
toConf = tomlFormat.generate "config.toml";
in
{
meta.maintainers = [ lib.maintainers.noodlez1232 ];
options.programs.chawan = {
enable = lib.mkEnableOption "chawan, A TUI web browser";
package = lib.mkPackageOption pkgs "chawan" { nullable = true; };
settings = lib.mkOption {
default = { };
type = tomlType;
description = ''
Configuration options for chawan.
See {manpage}`cha-config(5)`
'';
example = lib.literalExpression ''
{
buffer = {
images = true;
autofocus = true;
};
pager."C-k" = "() => pager.load('https://duckduckgo.com/?=')";
}
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile = lib.mkIf (cfg.settings != { }) {
"chawan/config.toml" = {
source = toConf cfg.settings;
};
};
};
}