nixos/getty: rename from services.mingetty

It's been 8.5 years since NixOS used mingetty, but the option was
never renamed (despite the file definining the module being renamed in
9f5051b76c1 ("Rename mingetty module to agetty")).

I've chosen to rename it to services.getty here, rather than
services.agetty, because getty is implemantation-neutral and also the
name of the unit that is generated.

Changed files
+20 -16
nixos
+1 -1
nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix
···
'';
# Some more help text.
-
services.mingetty.helpLine =
''
Log in as "root" with an empty password. ${
···
'';
# Some more help text.
+
services.getty.helpLine =
''
Log in as "root" with an empty password. ${
+1 -1
nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix
···
device = "/dev/something";
};
-
services.mingetty = {
# Some more help text.
helpLine = ''
Log in as "root" with an empty password. ${
···
device = "/dev/something";
};
+
services.getty = {
# Some more help text.
helpLine = ''
Log in as "root" with an empty password. ${
+1 -1
nixos/modules/misc/documentation.nix
···
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
-
services.mingetty.helpLine = mkIf cfg.doc.enable (
"\nRun 'nixos-help' for the NixOS manual."
);
})
···
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
+
services.getty.helpLine = mkIf cfg.doc.enable (
"\nRun 'nixos-help' for the NixOS manual."
);
})
+1 -1
nixos/modules/module-list.nix
···
./services/torrent/peerflix.nix
./services/torrent/rtorrent.nix
./services/torrent/transmission.nix
-
./services/ttys/agetty.nix
./services/ttys/gpm.nix
./services/ttys/kmscon.nix
./services/wayland/cage.nix
···
./services/torrent/peerflix.nix
./services/torrent/rtorrent.nix
./services/torrent/transmission.nix
+
./services/ttys/getty.nix
./services/ttys/gpm.nix
./services/ttys/kmscon.nix
./services/wayland/cage.nix
+2 -2
nixos/modules/profiles/installation-device.nix
···
};
# Automatically log in at the virtual consoles.
-
services.mingetty.autologinUser = "nixos";
# Some more help text.
-
services.mingetty.helpLine = ''
The "nixos" and "root" accounts have empty passwords.
An ssh daemon is running. You then must set a password
···
};
# Automatically log in at the virtual consoles.
+
services.getty.autologinUser = "nixos";
# Some more help text.
+
services.getty.helpLine = ''
The "nixos" and "root" accounts have empty passwords.
An ssh daemon is running. You then must set a password
+12 -8
nixos/modules/services/ttys/agetty.nix nixos/modules/services/ttys/getty.nix
···
let
-
autologinArg = optionalString (config.services.mingetty.autologinUser != null) "--autologin ${config.services.mingetty.autologinUser}";
gettyCmd = extraArgs: "@${pkgs.util-linux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login ${autologinArg} ${extraArgs}";
in
···
###### interface
options = {
-
services.mingetty = {
autologinUser = mkOption {
type = types.nullOr types.str;
···
greetingLine = mkOption {
type = types.str;
description = ''
-
Welcome line printed by mingetty.
The default shows current NixOS version label, machine type and tty.
'';
};
···
type = types.lines;
default = "";
description = ''
-
Help line printed by mingetty below the welcome line.
Used by the installation CD to give some hints on
how to proceed.
'';
···
config = {
# Note: this is set here rather than up there so that changing
# nixos.label would not rebuild manual pages
-
services.mingetty.greetingLine = mkDefault ''<<< Welcome to NixOS ${config.system.nixos.label} (\m) - \l >>>'';
systemd.services."getty@" =
{ serviceConfig.ExecStart = [
···
};
systemd.services."serial-getty@" =
-
let speeds = concatStringsSep "," (map toString config.services.mingetty.serialSpeed); in
{ serviceConfig.ExecStart = [
"" # override upstream default with an empty ExecStart
(gettyCmd "%I ${speeds} $TERM")
···
{ # Friendly greeting on the virtual consoles.
source = pkgs.writeText "issue" ''
-
${config.services.mingetty.greetingLine}
-
${config.services.mingetty.helpLine}
'';
};
···
let
+
autologinArg = optionalString (config.services.getty.autologinUser != null) "--autologin ${config.services.getty.autologinUser}";
gettyCmd = extraArgs: "@${pkgs.util-linux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login ${autologinArg} ${extraArgs}";
in
···
###### interface
+
imports = [
+
(mkRenamedOptionModule [ "services" "mingetty" ] [ "services" "getty" ])
+
];
+
options = {
+
services.getty = {
autologinUser = mkOption {
type = types.nullOr types.str;
···
greetingLine = mkOption {
type = types.str;
description = ''
+
Welcome line printed by agetty.
The default shows current NixOS version label, machine type and tty.
'';
};
···
type = types.lines;
default = "";
description = ''
+
Help line printed by agetty below the welcome line.
Used by the installation CD to give some hints on
how to proceed.
'';
···
config = {
# Note: this is set here rather than up there so that changing
# nixos.label would not rebuild manual pages
+
services.getty.greetingLine = mkDefault ''<<< Welcome to NixOS ${config.system.nixos.label} (\m) - \l >>>'';
systemd.services."getty@" =
{ serviceConfig.ExecStart = [
···
};
systemd.services."serial-getty@" =
+
let speeds = concatStringsSep "," (map toString config.services.getty.serialSpeed); in
{ serviceConfig.ExecStart = [
"" # override upstream default with an empty ExecStart
(gettyCmd "%I ${speeds} $TERM")
···
{ # Friendly greeting on the virtual consoles.
source = pkgs.writeText "issue" ''
+
${config.services.getty.greetingLine}
+
${config.services.getty.helpLine}
'';
};
+1 -1
nixos/modules/virtualisation/lxc-container.nix
···
users.users.root.initialHashedPassword = mkOverride 150 "";
# Some more help text.
-
services.mingetty.helpLine =
''
Log in as "root" with an empty password.
···
users.users.root.initialHashedPassword = mkOverride 150 "";
# Some more help text.
+
services.getty.helpLine =
''
Log in as "root" with an empty password.
+1 -1
nixos/tests/login.nix
···
with subtest("Virtual console logout"):
machine.send_chars("exit\n")
machine.wait_until_fails("pgrep -u alice bash")
-
machine.screenshot("mingetty")
with subtest("Check whether ctrl-alt-delete works"):
machine.send_key("ctrl-alt-delete")
···
with subtest("Virtual console logout"):
machine.send_chars("exit\n")
machine.wait_until_fails("pgrep -u alice bash")
+
machine.screenshot("getty")
with subtest("Check whether ctrl-alt-delete works"):
machine.send_key("ctrl-alt-delete")