Added rogue job used by CD

svn path=/nixos/trunk/; revision=13730
This commit is contained in:
Michael Raskin 2009-01-08 23:49:22 +00:00
parent 0a1f41c742
commit 9a46e71e7b
2 changed files with 65 additions and 0 deletions

View file

@ -3064,5 +3064,6 @@ root ALL=(ALL) SETENV: ALL
(import ../upstart-jobs/fcron.nix)
(import ../upstart-jobs/cron/locate.nix)
(import ../upstart-jobs/manual.nix)
(import ../upstart-jobs/rogue.nix)
];
}

64
upstart-jobs/rogue.nix Normal file
View file

@ -0,0 +1,64 @@
{pkgs, config}:
# Show rogue game on tty8
# Originally used only by installation CD
let
inherit (pkgs.lib) mkOption;
options = {
services = {
rogue = {
enable = mkOption {
default = false;
description = "
Whether to run rogue
";
};
ttyNumber = mkOption {
default = "8";
description = "
TTY number name to show the manual on
";
};
};
};
};
inherit (pkgs.lib) optional;
inherit (config.services.rogue) enable ttyNumber;
in
{
require = [
options
];
boot = {
extraTTYs = optional enable ttyNumber;
};
services = {
extraJobs = optional enable {
name = "rogue";
job = ''
description "rogue game"
start on udev
stop on shutdown
respawn ${pkgs.rogue}/bin/rogue < /dev/tty${toString ttyNumber} > /dev/tty${toString ttyNumber} 2>&1
'';
};
ttyBackgrounds = {
specificThemes = optional enable {
tty = ttyNumber;
theme = pkgs.themes "theme-gnu";
};
};
mingetty = {
helpLine = if enable then "\nPress <Alt-F${toString ttyNumber}> to play rogue." else "";
};
};
}