nix-config/modules/boot/greeter/greetd.nix
2025-09-08 10:28:06 +02:00

44 lines
1.2 KiB
Nix

{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf mkOption types;
cfg = config.horseman.boot.greeter.greetd;
homeCfg = config.horseman;
in {
options = {
horseman.boot.greeter.greetd = {
enable = mkEnableOption "Greetd Greeter";
session = mkOption {type = types.str;};
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
greetd.tuigreet
];
services.greetd = {
enable = true;
settings = {
default_session = {
user = homeCfg.username;
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-session --greeting 'Please authenticate to continue' --asterisks --asterisks-char '*' --theme 'border=74;text=cyan;prompt=green;time=cyan;action=cyan;button=cyan;container=black;input=238' --cmd ${cfg.session}";
};
};
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
};
}