From 484251d3b4f950fe0968cb69ffdf4d2fc1be72ac Mon Sep 17 00:00:00 2001 From: Lyndon Sanche Date: Wed, 10 Aug 2022 12:44:58 -0600 Subject: [PATCH] Check for proper input on bemenu module --- modules/bemenu.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/bemenu.nix b/modules/bemenu.nix index 59c2f023..d506ff76 100644 --- a/modules/bemenu.nix +++ b/modules/bemenu.nix @@ -5,11 +5,14 @@ with config.stylix.fonts; { options.stylix.targets.bemenu = { enable = config.lib.stylix.mkEnableTarget "bemenu" true; - fontSize = lib.mkOption { type = lib.types.str; default = ""; }; # optional argument + fontSize = lib.mkOption { + type = with lib.types; nullOr int; + default = null; + }; # optional argument alternate = lib.mkOption { type = lib.types.bool; default = false; }; }; - config.home-manager.sharedModules = lib.mkIf config.stylix.targets.mako.enable [{ + config.home-manager.sharedModules = lib.mkIf config.stylix.targets.bemenu.enable [{ home.sessionVariables.BEMENU_OPTS = with config.stylix.targets.bemenu; builtins.concatStringsSep " " [ # Inspired from https://git.sr.ht/~h4n1/base16-bemenu_opts "--tb '${base01}'" @@ -28,7 +31,7 @@ with config.stylix.fonts; "--ab '${if alternate then base00 else base01}'" "--af '${if alternate then base04 else base05}'" - "--fn '${sansSerif.name} ${fontSize}'" + "--fn '${sansSerif.name} ${lib.optionalString (fontSize != null) (builtins.toString fontSize)}'" ]; }]; }