about summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/me/mergiraf/module.nix29
-rw-r--r--modules/by-name/qu/qutebrowser/module.nix22
2 files changed, 48 insertions, 3 deletions
diff --git a/modules/by-name/me/mergiraf/module.nix b/modules/by-name/me/mergiraf/module.nix
new file mode 100644
index 00000000..474a0ae3
--- /dev/null
+++ b/modules/by-name/me/mergiraf/module.nix
@@ -0,0 +1,29 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{
+  config,
+  lib,
+  libraries,
+  ...
+}: let
+  cfg = config.soispha.programs.mergiraf;
+in {
+  options.soispha.programs.mergiraf = {
+    enable = libraries.base.options.mkEnable "mergiraf";
+  };
+
+  config = lib.mkIf cfg.enable {
+    home-manager.users.soispha = {
+      programs.mergiraf = {
+        enable = true;
+      };
+    };
+  };
+}
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: