feat(home): Add launcher to default apps module

This commit is contained in:
punkfairie 2025-01-12 11:12:41 -08:00
parent b5459aa815
commit fc937102da
No known key found for this signature in database
GPG key ID: B3C5488E9A1A7CA6
4 changed files with 43 additions and 7 deletions

View file

@ -28,7 +28,7 @@ in {
terminal = lib.mkOption { terminal = lib.mkOption {
type = lib.types.package; type = lib.types.package;
default = pkgs.wezterm; default = pkgs.wezterm;
description = "Ther terminal emulator to use."; description = "The terminal emulator to use.";
}; };
browser = lib.mkOption { browser = lib.mkOption {
@ -36,6 +36,28 @@ in {
default = pkgs.floorp; default = pkgs.floorp;
description = "The browser to use."; 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) { config = lib.mkIf (is-linux system) {

View file

@ -4,14 +4,12 @@
pkgs, pkgs,
inputs, inputs,
... ...
}: }: let
let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
cfg = config.marleyos.programs.rofi; cfg = config.marleyos.programs.rofi;
hasXorg = config.xsession.enable; hasXorg = config.xsession.enable;
in in {
{
options.marleyos.programs.rofi.enable = mkEnableOption "rofi"; options.marleyos.programs.rofi.enable = mkEnableOption "rofi";
config = mkIf (cfg.enable && hasXorg) { config = mkIf (cfg.enable && hasXorg) {
@ -19,6 +17,11 @@ in
rofi rofi
]; ];
marleyos.apps.launcher = {
package = pkgs.rofi;
command = "--show drun";
};
xdg.configFile."rofi".source = "${inputs.rofi-themes}/files"; xdg.configFile."rofi".source = "${inputs.rofi-themes}/files";
}; };
} }

View file

@ -1,6 +1,7 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: let }: let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkEnableOption mkIf;
@ -10,6 +11,11 @@ in {
options.marleyos.programs.wofi.enable = mkEnableOption "wofi"; options.marleyos.programs.wofi.enable = mkEnableOption "wofi";
config = mkIf cfg.enable { config = mkIf cfg.enable {
marleyos.apps.launcher = {
package = pkgs.wofi;
command = "--show drun";
};
programs.wofi = { programs.wofi = {
enable = true; enable = true;
}; };

View file

@ -38,7 +38,10 @@ in {
} }
]; ];
marleyos.programs.wofi.enable = true; marleyos = {
programs.wofi.enable = true;
services.waybar.enable = true;
};
home.pointerCursor.hyprcursor.enable = true; home.pointerCursor.hyprcursor.enable = true;
@ -109,7 +112,9 @@ in {
monitor = lib.attrValues cfg.monitors; monitor = lib.attrValues cfg.monitors;
"$terminal" = lib.getExe config.marleyos.apps.terminal; "$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; "$browser" = lib.getExe config.marleyos.apps.browser;
exec-once = let exec-once = let