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
9f5051b76c ("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.
This commit is contained in:
Alyssa Ross 2021-01-05 08:25:53 +00:00
parent 9a27606ab1
commit 6c3d21aff9
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0
8 changed files with 20 additions and 16 deletions

View File

@ -104,7 +104,7 @@ in
'';
# Some more help text.
services.mingetty.helpLine =
services.getty.helpLine =
''
Log in as "root" with an empty password. ${

View File

@ -122,7 +122,7 @@ in
device = "/dev/something";
};
services.mingetty = {
services.getty = {
# Some more help text.
helpLine = ''
Log in as "root" with an empty password. ${

View File

@ -261,7 +261,7 @@ in
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
services.mingetty.helpLine = mkIf cfg.doc.enable (
services.getty.helpLine = mkIf cfg.doc.enable (
"\nRun 'nixos-help' for the NixOS manual."
);
})

View File

@ -852,7 +852,7 @@
./services/torrent/peerflix.nix
./services/torrent/rtorrent.nix
./services/torrent/transmission.nix
./services/ttys/agetty.nix
./services/ttys/getty.nix
./services/ttys/gpm.nix
./services/ttys/kmscon.nix
./services/wayland/cage.nix

View File

@ -45,10 +45,10 @@ with lib;
};
# Automatically log in at the virtual consoles.
services.mingetty.autologinUser = "nixos";
services.getty.autologinUser = "nixos";
# Some more help text.
services.mingetty.helpLine = ''
services.getty.helpLine = ''
The "nixos" and "root" accounts have empty passwords.
An ssh daemon is running. You then must set a password

View File

@ -4,7 +4,7 @@ with lib;
let
autologinArg = optionalString (config.services.mingetty.autologinUser != null) "--autologin ${config.services.mingetty.autologinUser}";
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
@ -13,9 +13,13 @@ in
###### interface
imports = [
(mkRenamedOptionModule [ "services" "mingetty" ] [ "services" "getty" ])
];
options = {
services.mingetty = {
services.getty = {
autologinUser = mkOption {
type = types.nullOr types.str;
@ -29,7 +33,7 @@ in
greetingLine = mkOption {
type = types.str;
description = ''
Welcome line printed by mingetty.
Welcome line printed by agetty.
The default shows current NixOS version label, machine type and tty.
'';
};
@ -38,7 +42,7 @@ in
type = types.lines;
default = "";
description = ''
Help line printed by mingetty below the welcome line.
Help line printed by agetty below the welcome line.
Used by the installation CD to give some hints on
how to proceed.
'';
@ -65,7 +69,7 @@ in
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 >>>'';
services.getty.greetingLine = mkDefault ''<<< Welcome to NixOS ${config.system.nixos.label} (\m) - \l >>>'';
systemd.services."getty@" =
{ serviceConfig.ExecStart = [
@ -76,7 +80,7 @@ in
};
systemd.services."serial-getty@" =
let speeds = concatStringsSep "," (map toString config.services.mingetty.serialSpeed); in
let speeds = concatStringsSep "," (map toString config.services.getty.serialSpeed); in
{ serviceConfig.ExecStart = [
"" # override upstream default with an empty ExecStart
(gettyCmd "%I ${speeds} $TERM")
@ -106,8 +110,8 @@ in
{ # Friendly greeting on the virtual consoles.
source = pkgs.writeText "issue" ''
${config.services.mingetty.greetingLine}
${config.services.mingetty.helpLine}
${config.services.getty.greetingLine}
${config.services.getty.helpLine}
'';
};

View File

@ -11,7 +11,7 @@ with lib;
users.users.root.initialHashedPassword = mkOverride 150 "";
# Some more help text.
services.mingetty.helpLine =
services.getty.helpLine =
''
Log in as "root" with an empty password.

View File

@ -50,7 +50,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }:
with subtest("Virtual console logout"):
machine.send_chars("exit\n")
machine.wait_until_fails("pgrep -u alice bash")
machine.screenshot("mingetty")
machine.screenshot("getty")
with subtest("Check whether ctrl-alt-delete works"):
machine.send_key("ctrl-alt-delete")