From 1ee66ce836d4bcc4b55d900a0128df63f73ff9dd Mon Sep 17 00:00:00 2001 From: wrvsrx Date: Fri, 15 Aug 2025 19:01:24 +0800 Subject: [PATCH] nixos/greetd: add an option to avoid systemd boot messages interrupt greetd --- .../services/display-managers/greetd.nix | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/display-managers/greetd.nix b/nixos/modules/services/display-managers/greetd.nix index 9c967ac71696..dd0d6a04effe 100644 --- a/nixos/modules/services/display-managers/greetd.nix +++ b/nixos/modules/services/display-managers/greetd.nix @@ -59,6 +59,16 @@ in because every greetd restart will trigger the autologin again. ''; }; + + useTextGreeter = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether the greeter uses text-based user interfaces (For example, tuigreet). + + When set to true, some systemd service configuration will be adjusted to avoid systemd boot messages interrupt TUI. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -108,7 +118,19 @@ in KeyringMode = "shared"; Type = "idle"; - }; + } + // (lib.optionalAttrs cfg.useTextGreeter { + StandardInput = "tty"; + StandardOutput = "tty"; + # Without this errors will spam on screen + StandardError = "journal"; + + # Without these bootlogs will spam on screen + TTYPath = "/dev/tty1"; + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }); # Don't kill a user session when using nixos-rebuild restartIfChanged = false;