nichts/modules/services/greetd/module.nix

49 lines
1.1 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
cfg = config.modules.services.greetd;
2025-04-06 21:23:05 +02:00
uwsmEnabled = config.modules.services.uwsm.enable;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
inherit (lib.modules) mkIf;
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
then "uwsm start Hyprland"
else "Hyprland";
};
};
2024-05-05 20:28:17 +02:00
config = mkIf cfg.enable {
services.greetd = {
enable = true;
2025-04-06 21:23:05 +02:00
package = pkgs.greetd;
settings.default_session = {
2025-04-06 21:23:05 +02:00
command = ''
${pkgs.greetd.tuigreet}/bin/tuigreet \
2025-04-06 22:09:09 +02:00
-c \"${cfg.session}\" \
2025-04-06 21:23:05 +02:00
-r
-t --time-format "DD.MM.YYYY"
--asteriks'';
};
2025-04-06 22:09:09 +02:00
vt = 7;
2024-05-05 20:28:17 +02:00
};
};
2024-05-05 20:28:17 +02:00
}