nichts/modules/services/greetd/module.nix

60 lines
1.4 KiB
Nix
Raw Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
...
2025-04-06 21:23:05 +02:00
}: let
inherit (lib.meta) getExe getExe';
2025-04-09 15:31:18 +02:00
inherit (lib.modules) mkIf;
2025-04-06 21:23:05 +02:00
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
2025-04-09 15:31:18 +02:00
inherit (config.meta.mainUser) username;
cfg = config.modules.services.greetd;
uwsmEnabled = config.modules.services.uwsm.enable;
2024-05-05 20:28:17 +02:00
in {
options.modules.services.greetd = {
enable = mkEnableOption "greetd";
greeter = mkOption {
description = "greetd frontend to use";
2025-04-06 21:23:05 +02:00
type = str;
2024-05-05 20:28:17 +02:00
};
launchOptions = mkOption {
description = "/etc/greetd/environments as list of strings";
2025-04-06 21:23:05 +02:00
type = listOf str;
};
session = mkOption {
description = "Which login session to start";
type = str;
default =
if uwsmEnabled
2025-04-09 15:31:18 +02:00
then "${getExe config.programs.uwsm.package} start Hyprland"
2025-04-06 21:23:05 +02:00
else "Hyprland";
};
};
2024-05-05 20:28:17 +02:00
config = mkIf cfg.enable {
2025-04-09 15:31:18 +02:00
services.greetd = let
session = {
# command = ''
# ${pkgs.greetd.tuigreet}/bin/tuigreet \
# -c \"${cfg.session}\" \
# -r
# -t --time-format "DD.MM.YYYY"
# --asteriks'';
command = "${getExe config.programs.uwsm.package} start hyprland-uwsm.desktop";
user = username;
};
2025-04-09 15:31:18 +02:00
in {
enable = true;
package = pkgs.greetd;
2025-04-06 22:09:09 +02:00
vt = 7;
2025-04-09 15:31:18 +02:00
settings = {
default_session = session;
initial_session = session;
};
2024-05-05 20:28:17 +02:00
};
};
2024-05-05 20:28:17 +02:00
}