Commit 431a9761 authored by Will Fancher's avatar Will Fancher
Browse files

nixos/display-managers: tty1 everywhere

parent f8929b73
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@

- `go-mockery` has been updated to v3. For migration instructions see the [upstream documentation](https://vektra.github.io/mockery/latest/v3/). If v2 is still required `go-mockery_v2` has been added but will be removed on or before 2029-12-31 in-line with it's [upstream support lifecycle](https://vektra.github.io/mockery/

- NixOS display manager modules now strictly use tty1, where many of them previously used tty7. Options to configure display managers' VT have been dropped. A configuration with a display manager enabled will not start `getty@tty1.service`, even if the system is forced to boot into `multi-user.target` instead of `graphical.target`.

## Other Notable Changes {#sec-nixpkgs-release-25.11-notable-changes}

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
+10 −0
Original line number Diff line number Diff line
@@ -267,12 +267,22 @@ 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 = [
        "acpid.service"
        "systemd-logind.service"
        "systemd-user-sessions.service"
        "autovt@tty1.service"
      ];
      conflicts = [
        "autovt@tty1.service"
      ];
      restartIfChanged = false;

+0 −2
Original line number Diff line number Diff line
@@ -259,12 +259,10 @@ in
      "rc-local.service"
      "systemd-machined.service"
      "systemd-user-sessions.service"
      "getty@tty${gdm.initialVT}.service"
      "plymouth-quit.service"
      "plymouth-start.service"
    ];
    systemd.services.display-manager.conflicts = [
      "getty@tty${gdm.initialVT}.service"
      "plymouth-quit.service"
    ];
    systemd.services.display-manager.onFailure = [
+10 −10
Original line number Diff line number Diff line
@@ -6,10 +6,18 @@
}:
let
  cfg = config.services.greetd;
  tty = "tty${toString cfg.vt}";
  tty = "tty1";
  settingsFormat = pkgs.formats.toml { };
in
{
  imports = [
    (lib.mkRemovedOptionModule [
      "services"
      "greetd"
      "vt"
    ] "The VT is now fixed to VT1.")
  ];

  options.services.greetd = {
    enable = lib.mkEnableOption "greetd, a minimal and flexible login manager daemon";

@@ -41,14 +49,6 @@ in
      '';
    };

    vt = lib.mkOption {
      type = lib.types.int;
      default = 1;
      description = ''
        The virtual console (tty) that greetd should use. This option also disables getty on that tty.
      '';
    };

    restart = lib.mkOption {
      type = lib.types.bool;
      default = !(cfg.settings ? initial_session);
@@ -62,7 +62,7 @@ in
  };
  config = lib.mkIf cfg.enable {

    services.greetd.settings.terminal.vt = lib.mkDefault cfg.vt;
    services.greetd.settings.terminal.vt = 1;
    services.greetd.settings.default_session.user = lib.mkDefault "greeter";

    security.pam.services.greetd = {
+11 −12
Original line number Diff line number Diff line
@@ -9,6 +9,15 @@ let
  settingsFormat = pkgs.formats.toml { };
in
{
  imports = [
    (lib.mkRemovedOptionModule [
      "services"
      "displayManager"
      "lemurs"
      "vt"
    ] "The VT is now fixed to VT1.")
  ];

  options.services.displayManager.lemurs = {
    enable = lib.mkEnableOption "" // {
      description = ''
@@ -36,14 +45,6 @@ in
        See [lemurs configuration documentation](https://github.com/coastalwhite/lemurs/blob/main/extra/config.toml) for available options.
      '';
    };

    vt = lib.mkOption {
      type = lib.types.ints.positive;
      default = 2;
      description = ''
        The virtual console (tty) that lemurs should use.
      '';
    };
  };
  config = lib.mkIf cfg.enable {
    assertions = [
@@ -82,7 +83,7 @@ in
            desktops = config.services.displayManager.sessionData.desktops;
          in
          {
            tty = lib.mkDefault cfg.vt;
            tty = 1;
            system_shell = lib.mkDefault "${pkgs.bash}/bin/bash";
            initial_path = lib.mkDefault "/run/current-system/sw/bin";
            x11 = {
@@ -101,16 +102,14 @@ in
        Wants = [ "systemd-user-sessions.service" ];
        After = [
          "systemd-user-sessions.service"
          "getty@tty${toString cfg.vt}.service"
          "plymouth-quit-wait.service"
        ];
        Conflicts = [ "getty@tty${toString cfg.vt}.service" ];
      };
      serviceConfig = {
        Type = "idle";
        # Defaults from lemurs upstream configuration
        StandardInput = "tty";
        TTYPath = "/dev/tty${toString cfg.vt}";
        TTYPath = "/dev/tty1";
        TTYReset = "yes";
        TTYVHangup = "yes";
        # Clear the console before starting
Loading