Merge pull request #108465 from alyssais/getty

nixos/getty: rename from services.mingetty
This commit is contained in:
WORLDofPEACE 2021-01-05 10:10:34 -05:00 committed by GitHub
commit 57e1a17ad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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")