nichts/modules/services/greetd.nix

48 lines
1.1 KiB
Nix

{
config,
lib,
pkgs,
...
}: let
cfg = config.modules.services.greetd;
uwsmEnabled = config.modules.services.uwsm.enable;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
inherit (lib.modules) mkIf;
in {
options.modules.services.greetd = {
enable = mkEnableOption "greetd";
greeter = mkOption {
description = "greetd frontend to use";
type = str;
};
launchOptions = mkOption {
description = "/etc/greetd/environments as list of strings";
type = listOf str;
};
session = mkOption {
description = "Which login session to start";
type = str;
default =
if uwsmEnabled
then "uwsm start Hyprland"
else "Hyprland";
};
};
config = mkIf cfg.enable {
services.greetd = {
enable = true;
package = pkgs.greetd;
settings.default_session = {
command = ''
${pkgs.greetd.tuigreet}/bin/tuigreet \
-c \"${cfg.session}\" \
-r
-t --time-format "DD.MM.YYYY"
--asteriks'';
};
vt = 7;
};
};
}