nixos/display-manager: Disable the dependency on autovt@tty1 rather than masking it

This commit is contained in:
Will Fancher 2025-07-31 08:33:21 -04:00
parent aa855cb1a2
commit 8cb99658bd
2 changed files with 8 additions and 7 deletions

View File

@ -267,12 +267,6 @@ in
in
lib.mkIf noDmUsed (lib.mkDefault false);
# We can't just rely on 'Conflicts=autovt@tty1.service' because
# 'switch-to-configuration switch' will start 'autovt@tty1.service'
# and kill us.
systemd.services."autovt@tty1".enable =
lib.mkIf config.systemd.services.display-manager.enable false;
systemd.services.display-manager = {
description = "Display Manager";
after = [

View File

@ -148,7 +148,14 @@ in
"container-getty@.service"
];
systemd.targets.getty.wants = [ "autovt@tty1.service" ];
# We can't just rely on 'Conflicts=autovt@tty1.service' because
# 'switch-to-configuration switch' will start 'autovt@tty1.service'
# and kill the display manager.
systemd.targets.getty.wants =
lib.mkIf (!(config.systemd.services.display-manager.enable or false))
[
"autovt@tty1.service"
];
systemd.services."getty@" = {
serviceConfig.ExecStart = [