diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-16 15:22:06 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-06-16 15:22:06 +0200 |
commit | 79542199574aa3c1c7defced20394d87599bb521 (patch) | |
tree | f7f4d8f9827a3badaf072d870a14fbb9a11495ad /modules/by-name/qu/qutebrowser/module.nix | |
parent | modules/xdg: Inherit path for the url-handler script (diff) | |
download | nixos-config-79542199574aa3c1c7defced20394d87599bb521.zip |
modules/qutebrowser: Correctly quote the statusbar.widgets settings
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/qu/qutebrowser/module.nix | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/modules/by-name/qu/qutebrowser/module.nix b/modules/by-name/qu/qutebrowser/module.nix index 4ed7b626..dab06237 100644 --- a/modules/by-name/qu/qutebrowser/module.nix +++ b/modules/by-name/qu/qutebrowser/module.nix @@ -11,10 +11,26 @@ xdg_data_home = config.home-manager.users.soispha.xdg.dataHome; xdg_config_home = config.home-manager.users.soispha.xdg.configHome; - mkQutebrowser = name: + mkQutebrowser = name: let + statusbar_widgets = [ + "keypress" + "text:${name}" + "search_match" + "url" + "scroll" + "history" + "tabs" + "progress" + ]; + + statusbar_widgets_str = + # NOTE(@bpeetz): We need either two layers of escaping or the binary wrapper, as we first inline this + # into the runCommand below, and then into the actual qutebrowser wrapper script. <2025-06-16> + lib.strings.escapeShellArg (builtins.toJSON statusbar_widgets); + in pkgs.runCommandLocal "qutebrowser-${name}" { nativeBuildInputs = [ - pkgs.makeShellWrapper + pkgs.makeBinaryWrapper ]; } '' @@ -26,7 +42,7 @@ --add-flags "${xdg_config_home}/qutebrowser/config.py" \ --add-flags --set \ --add-flags statusbar.widgets \ - --add-flags '["keypress", "text:${name}", "search_match", "url", "scroll", "history", "tabs", "progress"]' + --add-flags ${statusbar_widgets_str} ''; in builtins.filter (val: val != null) (lib.mapAttrsToList (name: value: |