1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-24 19:29:40 +01:00
home-manager/tests/modules/programs/qutebrowser/settings.nix
octvs 29dda415f5
qutebrowser: add support for per domain settings (#7078)
Add `programs.qutebrowser.perDomainSettings` which let's one to set
configuration options for specific URLs [1].

It option doesn't check if the options passed to it are valid, it
translates the config to python code to be written on the file as is.
Mimicking the behaviour of `programs.qutebrowser.settings`.

Added a new test case `test-qutebrowser-url-settings` for testing the
implementation.

[1]: bb7bbb6ead/doc/help/configuring.asciidoc (per-domain-settings)
2025-05-20 12:43:52 -05:00

48 lines
1.1 KiB
Nix

{ pkgs, ... }:
{
programs.qutebrowser = {
enable = true;
settings = {
colors = {
hints = {
bg = "#000000";
fg = "#ffffff";
};
tabs.bar.bg = "#000000";
};
spellcheck.languages = [
"en-US"
"sv-SE"
];
tabs.tabs_are_windows = true;
};
extraConfig = ''
# Extra qutebrowser configuration.
'';
};
nmt.script =
let
qutebrowserConfig =
if pkgs.stdenv.hostPlatform.isDarwin then
".qutebrowser/config.py"
else
".config/qutebrowser/config.py";
in
''
assertFileContent \
home-files/${qutebrowserConfig} \
${builtins.toFile "qutebrowser-expected-config.py" ''
config.load_autoconfig(False)
config.set("colors.hints.bg", "#000000")
config.set("colors.hints.fg", "#ffffff")
config.set("colors.tabs.bar.bg", "#000000")
config.set("spellcheck.languages", ["en-US", "sv-SE"])
config.set("tabs.tabs_are_windows", True)
# Extra qutebrowser configuration.
''}
'';
}