diff --git a/modules/home/options/apps/default.nix b/modules/home/options/apps/default.nix index d03f1e8..9737b70 100644 --- a/modules/home/options/apps/default.nix +++ b/modules/home/options/apps/default.nix @@ -28,7 +28,7 @@ in { terminal = lib.mkOption { type = lib.types.package; default = pkgs.wezterm; - description = "Ther terminal emulator to use."; + description = "The terminal emulator to use."; }; browser = lib.mkOption { @@ -36,6 +36,28 @@ in { default = pkgs.floorp; description = "The browser to use."; }; + + launcher = lib.mkOption { + type = lib.types.submodule { + options = { + package = lib.mkOption { + type = lib.types.package; + default = + if config.marleyos.wayland.hyprland.enable + then pkgs.wofi + else pkgs.rofi; + description = "The launcher to use."; + }; + command = lib.mkOption { + type = lib.types.str; + default = "--show drun"; + description = '' + The command appended after the launcher binary to run it. + ''; + }; + }; + }; + }; }; config = lib.mkIf (is-linux system) { diff --git a/modules/home/programs/rofi/default.nix b/modules/home/programs/rofi/default.nix index f36a3c6..cfce5c8 100644 --- a/modules/home/programs/rofi/default.nix +++ b/modules/home/programs/rofi/default.nix @@ -4,14 +4,12 @@ pkgs, inputs, ... -}: -let +}: let inherit (lib) mkEnableOption mkIf; cfg = config.marleyos.programs.rofi; hasXorg = config.xsession.enable; -in -{ +in { options.marleyos.programs.rofi.enable = mkEnableOption "rofi"; config = mkIf (cfg.enable && hasXorg) { @@ -19,6 +17,11 @@ in rofi ]; + marleyos.apps.launcher = { + package = pkgs.rofi; + command = "--show drun"; + }; + xdg.configFile."rofi".source = "${inputs.rofi-themes}/files"; }; } diff --git a/modules/home/programs/wofi/default.nix b/modules/home/programs/wofi/default.nix index 94865d7..598816f 100644 --- a/modules/home/programs/wofi/default.nix +++ b/modules/home/programs/wofi/default.nix @@ -1,6 +1,7 @@ { lib, config, + pkgs, ... }: let inherit (lib) mkEnableOption mkIf; @@ -10,6 +11,11 @@ in { options.marleyos.programs.wofi.enable = mkEnableOption "wofi"; config = mkIf cfg.enable { + marleyos.apps.launcher = { + package = pkgs.wofi; + command = "--show drun"; + }; + programs.wofi = { enable = true; }; diff --git a/modules/home/wayland/hyprland/default.nix b/modules/home/wayland/hyprland/default.nix index 75417f0..ea9099d 100644 --- a/modules/home/wayland/hyprland/default.nix +++ b/modules/home/wayland/hyprland/default.nix @@ -38,7 +38,10 @@ in { } ]; - marleyos.programs.wofi.enable = true; + marleyos = { + programs.wofi.enable = true; + services.waybar.enable = true; + }; home.pointerCursor.hyprcursor.enable = true; @@ -109,7 +112,9 @@ in { monitor = lib.attrValues cfg.monitors; "$terminal" = lib.getExe config.marleyos.apps.terminal; - "$launcher" = "${lib.getExe pkgs.wofi} --show drun"; + "$launcher" = let + inherit (config.marleyos.apps) launcher; + in "${lib.getExe launcher.package} ${launcher.command}"; "$browser" = lib.getExe config.marleyos.apps.browser; exec-once = let