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

Changed files
+8 -7
nixos
modules
services
display-managers
ttys
-6
nixos/modules/services/display-managers/default.nix
···
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 = [
+8 -1
nixos/modules/services/ttys/getty.nix
···
"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 = [