nichts/modules/services/greetd.mod.nix

57 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2024-05-22 14:29:45 +02:00
{
config,
lib,
pkgs,
...
}:
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;
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;
2025-07-25 16:58:43 +02:00
default = "niri";
};
};
2024-05-05 20:28:17 +02:00
config = mkIf cfg.enable {
services.greetd =
let
session = {
2025-07-25 16:58:43 +02:00
command = ''
${getExe pkgs.greetd.tuigreet} \
-c \"${cfg.session}\" \
-r
-t --time-format "DD.MM.YYYY"
--asteriks'';
user = "greeter";
};
in
{
enable = true;
vt = 7;
settings = {
default_session = session;
initial_session = session;
};
2025-04-09 15:31:18 +02:00
};
};
2024-05-05 20:28:17 +02:00
}