about summary refs log tree commit diff stats
path: root/modules/by-name
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/qu/qutebrowser/module.nix22
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: