From 987271a6591705dd458f3b91292d402e96825ebc Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 20 Jan 2026 09:02:29 -0600 Subject: [PATCH] bemenu: revert back to `toCommandLineShell` Just reverting back to manual approach for backwards compatibility. Signed-off-by: Austin Horstman --- modules/programs/bemenu.nix | 8 +++++++- tests/modules/programs/bemenu/basic-configuration.nix | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/programs/bemenu.nix b/modules/programs/bemenu.nix index 673b2045..5bc6e336 100644 --- a/modules/programs/bemenu.nix +++ b/modules/programs/bemenu.nix @@ -54,7 +54,13 @@ in home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.sessionVariables = lib.mkIf (cfg.settings != { }) { - BEMENU_OPTS = lib.cli.toCommandLineShellGNU { } cfg.settings; + # Not using `toCommandLineShellGNU` since it doesn't handle short form options with empty strings + # https://github.com/nix-community/home-manager/issues/8544 + BEMENU_OPTS = lib.cli.toCommandLineShell (optionName: { + option = if builtins.stringLength optionName > 1 then "--${optionName}" else "-${optionName}"; + sep = null; + explicitBool = false; + }) cfg.settings; }; }; } diff --git a/tests/modules/programs/bemenu/basic-configuration.nix b/tests/modules/programs/bemenu/basic-configuration.nix index 3549d1d9..cf556ef6 100644 --- a/tests/modules/programs/bemenu/basic-configuration.nix +++ b/tests/modules/programs/bemenu/basic-configuration.nix @@ -22,6 +22,6 @@ nmt.script = '' assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - "export BEMENU_OPTS=\"'--ab=#1e1e2e' '--af=#cdd6f4' '--fb=#1e1e2e' '--ff=#cdd6f4' '--hb=#1e1e2e' '--hf=#f9e2af' --ignorecase '--line-height=28' '--nb=#1e1e2e' '--nf=#cdd6f4' '--prompt=open' '--tb=#1e1e2e' '--tf=#f38ba8' '--width-factor=0.300000'\"" + "export BEMENU_OPTS=\"--ab '#1e1e2e' --af '#cdd6f4' --fb '#1e1e2e' --ff '#cdd6f4' --hb '#1e1e2e' --hf '#f9e2af' --ignorecase --line-height 28 --nb '#1e1e2e' --nf '#cdd6f4' --prompt open --tb '#1e1e2e' --tf '#f38ba8' --width-factor 0.300000\"" ''; }