2009-03-06 12:27:15 +00:00
|
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
|
|
let
|
2009-07-16 13:55:11 +00:00
|
|
|
|
|
|
|
|
|
inherit (pkgs.lib) mkOption mkIf singleton;
|
|
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
###### interface
|
2009-03-06 12:27:15 +00:00
|
|
|
|
|
|
|
|
|
options = {
|
2009-07-16 13:55:11 +00:00
|
|
|
|
|
|
|
|
|
services.mingetty = {
|
|
|
|
|
|
|
|
|
|
ttys = mkOption {
|
2009-09-23 20:50:53 +00:00
|
|
|
|
default = [ "tty1" "tty2" "tty3" "tty4" "tty5" "tty6" ];
|
2009-07-16 13:55:11 +00:00
|
|
|
|
description = ''
|
2009-09-23 20:50:53 +00:00
|
|
|
|
The list of tty devices on which to start a login prompt.
|
2009-07-16 13:55:11 +00:00
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
waitOnMounts = mkOption {
|
|
|
|
|
default = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether the login prompts on the virtual consoles will be
|
|
|
|
|
started before or after all file systems have been mounted. By
|
|
|
|
|
default we don't wait, but if for example your /home is on a
|
|
|
|
|
separate partition, you may want to turn this on.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
greetingLine = mkOption {
|
|
|
|
|
default = ''<<< Welcome to NixOS (\m) - Kernel \r (\l) >>>'';
|
|
|
|
|
description = ''
|
|
|
|
|
Welcome line printed by mingetty.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2009-03-06 12:27:15 +00:00
|
|
|
|
|
2009-07-16 13:55:11 +00:00
|
|
|
|
helpLine = mkOption {
|
|
|
|
|
default = "";
|
|
|
|
|
description = ''
|
|
|
|
|
Help line printed by mingetty below the welcome line.
|
|
|
|
|
Used by the installation CD to give some hints on
|
|
|
|
|
how to proceed.
|
|
|
|
|
'';
|
2009-03-06 12:27:15 +00:00
|
|
|
|
};
|
2009-07-16 13:55:11 +00:00
|
|
|
|
|
2009-03-06 12:27:15 +00:00
|
|
|
|
};
|
2009-07-16 13:55:11 +00:00
|
|
|
|
|
2009-03-06 12:27:15 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2009-07-16 13:55:11 +00:00
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
|
|
|
|
|
|
# Generate a separate job for each tty.
|
2009-09-23 20:50:53 +00:00
|
|
|
|
jobs = map (tty: {
|
2009-03-06 12:27:15 +00:00
|
|
|
|
|
2009-09-23 20:50:53 +00:00
|
|
|
|
name = tty;
|
2006-11-19 20:07:45 +00:00
|
|
|
|
|
2009-07-16 13:55:11 +00:00
|
|
|
|
startOn = "udev";
|
|
|
|
|
|
2009-09-23 20:50:53 +00:00
|
|
|
|
exec = "${pkgs.mingetty}/sbin/mingetty --loginprog=${pkgs.pam_login}/bin/login --noclear ${tty}";
|
2009-07-16 13:55:11 +00:00
|
|
|
|
|
|
|
|
|
}) config.services.mingetty.ttys;
|
|
|
|
|
|
|
|
|
|
environment.etc = singleton
|
|
|
|
|
{ # Friendly greeting on the virtual consoles.
|
2009-05-28 11:34:46 +00:00
|
|
|
|
source = pkgs.writeText "issue" ''
|
|
|
|
|
|
|
|
|
|
[1;32m${config.services.mingetty.greetingLine}[0m
|
|
|
|
|
${config.services.mingetty.helpLine}
|
|
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
target = "issue";
|
2009-07-16 13:55:11 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2006-11-19 20:07:45 +00:00
|
|
|
|
}
|