3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/modules/services/ttys/mingetty.nix
Eelco Dolstra 7cb4503ad6 * More Upstart refactoring.
svn path=/nixos/branches/modular-nixos/; revision=16394
2009-07-16 13:55:11 +00:00

84 lines
1.8 KiB
Nix
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{pkgs, config, ...}:
let
inherit (pkgs.lib) mkOption mkIf singleton;
in
{
###### interface
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.
'';
};
};
};
###### implementation
config = {
# Generate a separate job for each tty.
jobs = map (ttyNumber: {
name = "tty${toString ttyNumber}";
startOn = "udev";
exec = "${pkgs.mingetty}/sbin/mingetty --loginprog=${pkgs.pam_login}/bin/login --noclear tty${toString ttyNumber}";
}) config.services.mingetty.ttys;
environment.etc = singleton
{ # Friendly greeting on the virtual consoles.
source = pkgs.writeText "issue" ''
${config.services.mingetty.greetingLine}
${config.services.mingetty.helpLine}
'';
target = "issue";
};
};
}