marleyos/modules/home/programs/amfora/default.nix

92 lines
1.8 KiB
Nix
Raw Normal View History

2024-11-16 12:08:05 -08:00
{
lib,
config,
pkgs,
inputs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
2024-11-16 12:08:05 -08:00
cfg = config.marleyos.programs.amfora;
inherit (config.marleyos.theme) colors;
2024-11-16 12:08:05 -08:00
themeFiles = {
rose-pine = "${inputs.rose-pine-amfora}/themes/rose-pine.toml";
};
themeFile = themeFiles."${colors.base}";
2024-11-16 12:08:05 -08:00
in
{
2024-11-16 23:05:17 -08:00
options.marleyos = mkEnableModule "programs.amfora";
2024-11-16 12:08:05 -08:00
config = mkIf cfg.enable {
home.packages = with pkgs; [
amfora
];
xdg.configFile."amfora/theme.toml".source = "${themeFile}";
# https://github.com/makeworld-the-better-one/amfora/blob/master/default-config.toml
# Amfora requires a number of options to run - omitting everything I didn't
# care to customize resulted in go panic errors.
xdg.configFile."amfora/config.toml".text = # toml
''
include = "./theme.toml"
[a-general]
# Defaults {{{
home = "gemini://geminiprotocol.net"
auto_redirect = false
http = 'default'
search = "gemini://geminispace.info/search"
color = true
ansi = true
highlight_code = true
bullets = true
show_link = false
max_width = 80
downloads = '''
page_max_size = 2097152 # 2 MiB
page_max_time = 10
scrollbar = "auto"
underline = true
# }}}
highlight_style = "${colors.base}"
2024-11-16 12:08:05 -08:00
# Defaults {{{
[auth]
[auth.certs]
[auth.keys]
[keybindings]
[url-handlers]
other = 'default'
[url-prompts]
[cache]
max_size = 0
max_pages = 30
timeout = 1800
[proxies]
[subscriptions]
popup = true
update_interval = 1800
workers = 3
entries_per_page = 20
header = true
[theme]
# }}}
'';
};
}