nixpkgs/modules/services/ttys/mingetty.nix
Eelco Dolstra 5ebdee3577 * Continued refactoring the tree: moved most Upstart jobs (namely
those that run daemons) to modules/services.  This probably broke
  some things since there are a few relative paths in modules
  (e.g. imports of system/ids.nix).
* Moved some PAM modules out of etc/pam.d to the directories of NixOS
  modules that use them.

svn path=/nixos/branches/modular-nixos/; revision=15717
2009-05-24 23:13:23 +00:00

75 lines
1.7 KiB
Nix

{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
options = {
services = {
mingetty = {
ttys = mkOption {
default = [1 2 3 4 5 6];
description = "
The list of tty (virtual console) devices on which to start a
login prompt.
";
};
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.
";
};
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.
";
};
};
};
};
in
###### implementation
let
ttyNumbers = config.services.mingetty.ttys;
loginProgram = "${pkgs.pam_login}/bin/login";
inherit (pkgs) mingetty;
in
{
require = [
options
];
services = {
extraJobs = map (ttyNumber : {
name = "tty" + toString ttyNumber;
job = "
start on udev
stop on shutdown
respawn ${mingetty}/sbin/mingetty --loginprog=${loginProgram} --noclear tty${toString ttyNumber}
";
}) ttyNumbers;
};
}