* More Upstart refactoring.
svn path=/nixos/branches/modular-nixos/; revision=16394
This commit is contained in:
parent
bb292fdf04
commit
7cb4503ad6
@ -129,8 +129,6 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
exec = "${openssh}/sbin/sshd -D -h /etc/ssh/ssh_host_dsa_key -f ${sshdConfig}";
|
exec = "${openssh}/sbin/sshd -D -h /etc/ssh/ssh_host_dsa_key -f ${sshdConfig}";
|
||||||
|
|
||||||
respawn = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,77 +1,75 @@
|
|||||||
{pkgs, config, ...}:
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
###### interface
|
|
||||||
let
|
let
|
||||||
inherit (pkgs.lib) mkOption mkIf;
|
|
||||||
|
|
||||||
options = {
|
inherit (pkgs.lib) mkOption mkIf singleton;
|
||||||
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
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
require = [
|
|
||||||
options
|
|
||||||
];
|
|
||||||
|
|
||||||
services.extraJobs = map (ttyNumber : {
|
###### interface
|
||||||
name = "tty" + toString ttyNumber;
|
|
||||||
job = ''
|
|
||||||
start on udev
|
|
||||||
stop on shutdown
|
|
||||||
respawn ${mingetty}/sbin/mingetty --loginprog=${loginProgram} --noclear tty${toString ttyNumber}
|
|
||||||
'';
|
|
||||||
}) ttyNumbers;
|
|
||||||
|
|
||||||
environment.etc =
|
options = {
|
||||||
[ { # Friendly greeting on the virtual consoles.
|
|
||||||
|
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" ''
|
source = pkgs.writeText "issue" ''
|
||||||
|
|
||||||
[1;32m${config.services.mingetty.greetingLine}[0m
|
[1;32m${config.services.mingetty.greetingLine}[0m
|
||||||
@ -79,6 +77,7 @@ in
|
|||||||
|
|
||||||
'';
|
'';
|
||||||
target = "issue";
|
target = "issue";
|
||||||
}
|
};
|
||||||
];
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ in
|
|||||||
|
|
||||||
stopOn = mkOption {
|
stopOn = mkOption {
|
||||||
type = types.string;
|
type = types.string;
|
||||||
default = "";
|
default = "shutdown";
|
||||||
description = ''
|
description = ''
|
||||||
The Upstart event that triggers this job to be stopped.
|
The Upstart event that triggers this job to be stopped.
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user