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 {
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) {

View file

@ -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";
};
}

View file

@ -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;
};

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;
@ -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