From 5c9c5bbbc4fb382e372ad3b048b9cfc89beb2e6f Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Mon, 30 Jun 2025 14:47:28 +0200 Subject: [PATCH] feat: extract seatd service to reusable module with boot log suppression - Create modules/services/seatd.nix for clean greetd/tuigreet login experience - Add boot log suppression options to prevent systemd messages on login screen - Configure kernel parameters and journald to minimize console noise - Update both little-rascal and congenital-optimist to use new seatd module - Ensure consistent login experience across all machines - Maintain compatibility with existing lab tool (binary name: lab) --- .../congenital-optimist/configuration.nix | 13 +-- machines/little-rascal/configuration.nix | 17 ++-- modules/services/seatd.nix | 85 +++++++++++++++++++ 3 files changed, 94 insertions(+), 21 deletions(-) create mode 100644 modules/services/seatd.nix diff --git a/machines/congenital-optimist/configuration.nix b/machines/congenital-optimist/configuration.nix index 9aa90ea..dbedec9 100644 --- a/machines/congenital-optimist/configuration.nix +++ b/machines/congenital-optimist/configuration.nix @@ -18,6 +18,7 @@ # Services ../../modules/services/nfs-client.nix + ../../modules/services/seatd.nix # Desktop environments ../../modules/desktop/common.nix @@ -60,16 +61,8 @@ ]; }; - # Display manager - use greetd instead of cosmic-greeter - services.greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${pkgs.zsh}/bin/zsh"; - user = "greeter"; - }; - }; - }; + # Enable clean seatd/greetd login + services.seatd-clean.enable = true; # ZFS services for this machine services.zfs = { diff --git a/machines/little-rascal/configuration.nix b/machines/little-rascal/configuration.nix index 19e188a..28de999 100644 --- a/machines/little-rascal/configuration.nix +++ b/machines/little-rascal/configuration.nix @@ -46,6 +46,9 @@ # Security ../../modules/security/ssh-keys.nix + + # Services + ../../modules/services/seatd.nix ]; networking = { @@ -90,21 +93,13 @@ # Laptop-specific services services = { + # Enable clean seatd/greetd login + seatd-clean.enable = true; + # Power management for laptop power-profiles-daemon.enable = true; upower.enable = true; - # Display manager - greetd = { - enable = true; - settings = { - default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${pkgs.zsh}/bin/zsh"; - user = "greeter"; - }; - }; - }; - # Essential services tailscale.enable = true; blueman.enable = true; diff --git a/modules/services/seatd.nix b/modules/services/seatd.nix new file mode 100644 index 0000000..92b7223 --- /dev/null +++ b/modules/services/seatd.nix @@ -0,0 +1,85 @@ +# Seatd service module with greetd display manager and boot log suppression +# This module provides a clean login experience without systemd boot messages +{ + config, + lib, + pkgs, + ... +}: +with lib; { + options.services.seatd-clean = { + enable = mkEnableOption "seatd with greetd and clean boot"; + + suppressBootMessages = mkOption { + type = types.bool; + default = true; + description = "Whether to suppress systemd boot messages that interfere with login screen"; + }; + + tuigreetCommand = mkOption { + type = types.str; + default = "${pkgs.zsh}/bin/zsh"; + description = "Command to execute after login via tuigreet"; + }; + }; + + config = mkIf config.services.seatd-clean.enable { + # Enable greetd display manager with tuigreet + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${config.services.seatd-clean.tuigreetCommand}"; + user = "greeter"; + }; + }; + }; + + # Suppress systemd boot messages when enabled + boot = mkIf config.services.seatd-clean.suppressBootMessages { + # Kernel parameters to reduce boot noise + kernelParams = [ + "quiet" # Reduce kernel messages + "systemd.show_status=false" # Hide systemd startup status + "rd.systemd.show_status=false" # Hide initrd systemd status + "rd.udev.log_level=3" # Reduce udev messages + "udev.log_level=3" # Reduce udev messages + ]; + + # Console configuration + consoleLogLevel = 0; # Minimum console log level + + # Plymouth for clean boot (optional) + plymouth = { + enable = false; # Keep disabled for now, can be enabled if desired + }; + }; + + # Systemd and journald configuration to reduce noise + systemd = mkIf config.services.seatd-clean.suppressBootMessages { + # Reduce log levels + extraConfig = '' + LogLevel=warning + DefaultStandardOutput=null + DefaultStandardError=null + ''; + }; + + # Journald configuration + services.journald = mkIf config.services.seatd-clean.suppressBootMessages { + extraConfig = '' + # Reduce console output + ForwardToConsole=no + MaxLevelConsole=warning + # Keep reasonable log retention + MaxRetentionSec=7day + SystemMaxUse=500M + ''; + }; + + # Ensure proper TTY configuration for clean display + console = { + earlySetup = true; + }; + }; +}