* Simplification.

svn path=/nixu/trunk/; revision=7076
This commit is contained in:
Eelco Dolstra 2006-11-19 21:03:22 +00:00
parent fb4ab4bc8e
commit 70aca5974c
6 changed files with 41 additions and 32 deletions

View File

@ -81,25 +81,29 @@ rec {
upstartJobs = import ./upstart-jobs/gather.nix {
inherit (pkgs) stdenv;
jobs = [
# For the builtin logd job.
pkgs.upstart
# The terminals on ttyX.
(map
(ttyNumber: import ./upstart-jobs/mingetty.nix {
inherit (pkgs) genericSubstituter;
mingetty = pkgs.mingettyWrapper;
inherit ttyNumber;
})
[1 2 3 4 5 6]
)
jobs = map makeJob [
# Syslogd.
(import ./upstart-jobs/syslogd.nix {
inherit (pkgs) genericSubstituter sysklogd;
inherit (pkgs) sysklogd;
})
];
]
# The terminals on ttyX.
++ (map
(ttyNumber: makeJob (import ./upstart-jobs/mingetty.nix {
mingetty = pkgs.mingettyWrapper;
inherit ttyNumber;
}))
[1 2 3 4 5 6]
)
# For the builtin logd job.
++ [pkgs.upstart];
};
makeJob = import ./upstart-jobs/make-job.nix {
inherit (pkgs) stdenv;
};

View File

@ -0,0 +1,7 @@
{stdenv}: job:
stdenv.mkDerivation {
inherit (job) name job;
builder = builtins.toFile "builder.sh"
"source $stdenv/setup; ensureDir $out/etc/event.d; echo \"$job\" > $out/etc/event.d/$name";
}

View File

@ -1,8 +1,10 @@
{genericSubstituter, mingetty, ttyNumber}:
{mingetty, ttyNumber}:
genericSubstituter {
src = ./mingetty.sh;
dir = "etc/event.d";
{
name = "tty" + toString ttyNumber;
inherit mingetty ttyNumber;
job = "
start on startup
stop on shutdown
respawn ${mingetty}/sbin/mingetty --noclear tty${toString ttyNumber}
";
}

View File

@ -1,3 +0,0 @@
start on startup
stop on shutdown
respawn @mingetty@/sbin/mingetty --noclear tty@ttyNumber@

View File

@ -1,8 +1,10 @@
{genericSubstituter, sysklogd}:
{sysklogd}:
genericSubstituter {
src = ./syslogd.sh;
dir = "etc/event.d";
{
name = "syslogd";
inherit sysklogd;
job = "
start on startup
stop on shutdown
respawn ${sysklogd}/sbin/syslogd -n
";
}

View File

@ -1,3 +0,0 @@
start on startup
stop on shutdown
respawn @sysklogd@/sbin/syslogd -n