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:
parent
9a27606ab1
commit
6c3d21aff9
@ -104,7 +104,7 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# Some more help text.
|
# Some more help text.
|
||||||
services.mingetty.helpLine =
|
services.getty.helpLine =
|
||||||
''
|
''
|
||||||
|
|
||||||
Log in as "root" with an empty password. ${
|
Log in as "root" with an empty password. ${
|
||||||
|
@ -122,7 +122,7 @@ in
|
|||||||
device = "/dev/something";
|
device = "/dev/something";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mingetty = {
|
services.getty = {
|
||||||
# Some more help text.
|
# Some more help text.
|
||||||
helpLine = ''
|
helpLine = ''
|
||||||
Log in as "root" with an empty password. ${
|
Log in as "root" with an empty password. ${
|
||||||
|
@ -261,7 +261,7 @@ in
|
|||||||
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
|
++ optionals cfg.doc.enable ([ manual.manualHTML nixos-help ]
|
||||||
++ optionals config.services.xserver.enable [ pkgs.nixos-icons ]);
|
++ 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."
|
"\nRun 'nixos-help' for the NixOS manual."
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
@ -852,7 +852,7 @@
|
|||||||
./services/torrent/peerflix.nix
|
./services/torrent/peerflix.nix
|
||||||
./services/torrent/rtorrent.nix
|
./services/torrent/rtorrent.nix
|
||||||
./services/torrent/transmission.nix
|
./services/torrent/transmission.nix
|
||||||
./services/ttys/agetty.nix
|
./services/ttys/getty.nix
|
||||||
./services/ttys/gpm.nix
|
./services/ttys/gpm.nix
|
||||||
./services/ttys/kmscon.nix
|
./services/ttys/kmscon.nix
|
||||||
./services/wayland/cage.nix
|
./services/wayland/cage.nix
|
||||||
|
@ -45,10 +45,10 @@ with lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Automatically log in at the virtual consoles.
|
# Automatically log in at the virtual consoles.
|
||||||
services.mingetty.autologinUser = "nixos";
|
services.getty.autologinUser = "nixos";
|
||||||
|
|
||||||
# Some more help text.
|
# Some more help text.
|
||||||
services.mingetty.helpLine = ''
|
services.getty.helpLine = ''
|
||||||
The "nixos" and "root" accounts have empty passwords.
|
The "nixos" and "root" accounts have empty passwords.
|
||||||
|
|
||||||
An ssh daemon is running. You then must set a password
|
An ssh daemon is running. You then must set a password
|
||||||
|
@ -4,7 +4,7 @@ with lib;
|
|||||||
|
|
||||||
let
|
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}";
|
gettyCmd = extraArgs: "@${pkgs.util-linux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login ${autologinArg} ${extraArgs}";
|
||||||
|
|
||||||
in
|
in
|
||||||
@ -13,9 +13,13 @@ in
|
|||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule [ "services" "mingetty" ] [ "services" "getty" ])
|
||||||
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
services.mingetty = {
|
services.getty = {
|
||||||
|
|
||||||
autologinUser = mkOption {
|
autologinUser = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
@ -29,7 +33,7 @@ in
|
|||||||
greetingLine = mkOption {
|
greetingLine = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = ''
|
description = ''
|
||||||
Welcome line printed by mingetty.
|
Welcome line printed by agetty.
|
||||||
The default shows current NixOS version label, machine type and tty.
|
The default shows current NixOS version label, machine type and tty.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@ -38,7 +42,7 @@ in
|
|||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
description = ''
|
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
|
Used by the installation CD to give some hints on
|
||||||
how to proceed.
|
how to proceed.
|
||||||
'';
|
'';
|
||||||
@ -65,7 +69,7 @@ in
|
|||||||
config = {
|
config = {
|
||||||
# Note: this is set here rather than up there so that changing
|
# Note: this is set here rather than up there so that changing
|
||||||
# nixos.label would not rebuild manual pages
|
# 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@" =
|
systemd.services."getty@" =
|
||||||
{ serviceConfig.ExecStart = [
|
{ serviceConfig.ExecStart = [
|
||||||
@ -76,7 +80,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."serial-getty@" =
|
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 = [
|
{ serviceConfig.ExecStart = [
|
||||||
"" # override upstream default with an empty ExecStart
|
"" # override upstream default with an empty ExecStart
|
||||||
(gettyCmd "%I ${speeds} $TERM")
|
(gettyCmd "%I ${speeds} $TERM")
|
||||||
@ -106,8 +110,8 @@ in
|
|||||||
{ # Friendly greeting on the virtual consoles.
|
{ # Friendly greeting on the virtual consoles.
|
||||||
source = pkgs.writeText "issue" ''
|
source = pkgs.writeText "issue" ''
|
||||||
|
|
||||||
[1;32m${config.services.mingetty.greetingLine}[0m
|
[1;32m${config.services.getty.greetingLine}[0m
|
||||||
${config.services.mingetty.helpLine}
|
${config.services.getty.helpLine}
|
||||||
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
@ -11,7 +11,7 @@ with lib;
|
|||||||
users.users.root.initialHashedPassword = mkOverride 150 "";
|
users.users.root.initialHashedPassword = mkOverride 150 "";
|
||||||
|
|
||||||
# Some more help text.
|
# Some more help text.
|
||||||
services.mingetty.helpLine =
|
services.getty.helpLine =
|
||||||
''
|
''
|
||||||
|
|
||||||
Log in as "root" with an empty password.
|
Log in as "root" with an empty password.
|
||||||
|
@ -50,7 +50,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }:
|
|||||||
with subtest("Virtual console logout"):
|
with subtest("Virtual console logout"):
|
||||||
machine.send_chars("exit\n")
|
machine.send_chars("exit\n")
|
||||||
machine.wait_until_fails("pgrep -u alice bash")
|
machine.wait_until_fails("pgrep -u alice bash")
|
||||||
machine.screenshot("mingetty")
|
machine.screenshot("getty")
|
||||||
|
|
||||||
with subtest("Check whether ctrl-alt-delete works"):
|
with subtest("Check whether ctrl-alt-delete works"):
|
||||||
machine.send_key("ctrl-alt-delete")
|
machine.send_key("ctrl-alt-delete")
|
||||||
|
Loading…
Reference in New Issue
Block a user