Files
home-manager/modules/programs/chawan.nix
Austin Horstman 355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00

46 lines
1015 B
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 = {
buffer = {
images = true;
autofocus = true;
};
page."C-k" = "() => pager.load('ddg:')";
};
};
};
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;
};
};
};
}