nichts/modules/services/greetd/module.nix

58 lines
1.4 KiB
Nix

{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str listOf;
inherit (config.meta.mainUser) username;
cfg = config.modules.services.greetd;
uwsmEnabled = config.modules.services.uwsm.enable;
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 "${getExe config.programs.uwsm.package} start Hyprland"
else "Hyprland";
};
};
config = mkIf cfg.enable {
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;
};
in {
enable = true;
package = pkgs.greetd;
vt = 7;
settings = {
default_session = session;
initial_session = session;
};
};
};
}