Kieran's opinionated (and probably slightly dumb) nix config
1{ lib, config, ... }:
2{
3 options.atelier.apps.qutebrowser.enable = lib.mkEnableOption "Enable Qutebrowser config";
4 config = lib.mkIf config.atelier.apps.qutebrowser.enable {
5 programs.qutebrowser = {
6 enable = true;
7 settings = {
8 colors.webpage = {
9 darkmode.enabled = true;
10 preferred_color_scheme = "dark";
11 };
12 content.blocking = {
13 enabled = true;
14 hosts.lists = [
15 "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
16 ];
17 method = "both";
18 };
19 url.default_page = "http://ember:8081/";
20 url.start_pages = [ "http://ember:8081/" ];
21 };
22 extraConfig = ''
23 config.bind("<Space>ff", "cmd-set-text -s :open")
24 config.bind("<Space>fw", "cmd-set-text -s :open -t")
25 config.bind("<Space>fb", "cmd-set-text -s :tab-focus")
26 config.bind("<Space>fo", "history -t")
27 config.bind("<Space><Return>", "bookmark-list --jump")
28 config.bind("<Space>bc", "tab-clone")
29 config.bind("<Space>bZ", "tab-only")
30 config.bind("<Space>p", "tab-pin")
31 config.bind("<Space>r", "reload")
32 config.bind("<Space>yy", "yank")
33 config.bind("<Space>yd", "yank domain")
34 config.bind("<Space>ym", "yank inline [{title}]({url:yank})")
35 config.bind("<Space>yn", "yank inline ({url:yank})[{title}]")
36 config.bind("<Space>yt", "yank title")
37 config.bind("<Ctrl-c>", "tab-close")
38 config.bind("<Ctrl-C>", "tab-close -o")
39 config.bind("<Space>i", "config-cycle content.images true false")
40 config.bind("<Space>j", "config-cycle content.javascript.enabled true false")
41 config.bind("<Ctrl-V>", "fake-key -g <Ctrl-v>")
42 config.bind("<ctrl-alt-c>", "config-cycle tabs.show always never")
43
44 c.url.searchengines = { "DEFAULT": "https://s.dunkirk.sh/?q={}" }
45 '';
46 };
47 };
48}