From 89adfc9f0168e4aff48157c9cc84913c852d6a48 Mon Sep 17 00:00:00 2001 From: seylerius Date: Mon, 27 Jul 2020 03:54:11 -0500 Subject: [PATCH] qutebrowser: unwrap list from keybinding removal The option to remove the default keybindings by setting the `programs.qutebrowser.enableDefaultKeybindings` variable to `false` had a list wrapped around the `config.py` line. This would cause a type coercion error. PR #1410 --- modules/programs/qutebrowser.nix | 2 +- tests/modules/programs/qutebrowser/keybindings.nix | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/programs/qutebrowser.nix b/modules/programs/qutebrowser.nix index 60e043fb8..798363fb1 100644 --- a/modules/programs/qutebrowser.nix +++ b/modules/programs/qutebrowser.nix @@ -261,7 +261,7 @@ in { ++ mapAttrsToList (formatDictLine "c.url.searchengines") cfg.searchEngines ++ mapAttrsToList (formatDictLine "c.bindings.key_mappings") cfg.keyMappings - ++ optional (!cfg.enableDefaultBindings) [ "c.bindings.default = {}" ] + ++ optional (!cfg.enableDefaultBindings) "c.bindings.default = {}" ++ mapAttrsToList formatKeyBindings cfg.keyBindings ++ optional (cfg.extraConfig != "") cfg.extraConfig); }; diff --git a/tests/modules/programs/qutebrowser/keybindings.nix b/tests/modules/programs/qutebrowser/keybindings.nix index dc5c4dc11..e89e44b46 100644 --- a/tests/modules/programs/qutebrowser/keybindings.nix +++ b/tests/modules/programs/qutebrowser/keybindings.nix @@ -7,6 +7,8 @@ with lib; programs.qutebrowser = { enable = true; + enableDefaultBindings = false; + keyBindings = { normal = { "" = "spawn mpv {url}"; @@ -27,6 +29,7 @@ with lib; home-files/.config/qutebrowser/config.py \ ${ pkgs.writeText "qutebrowser-expected-config.py" '' + c.bindings.default = {} config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal") config.bind("", "spawn mpv {url}", mode="normal") config.bind("", "prompt-yes", mode="prompt")''