2009-01-25 16:22:17 +01:00
|
|
|
{pkgs, config, ...}:
|
2009-01-09 00:49:22 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2009-06-09 00:44:59 +02:00
|
|
|
cfg = config.services.rogue;
|
2009-01-09 00:49:22 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-06-09 00:44:59 +02:00
|
|
|
pkgs.lib.mkIf cfg.enable {
|
|
|
|
require = [options];
|
2009-01-09 00:49:22 +01:00
|
|
|
|
2009-06-09 00:44:59 +02:00
|
|
|
boot.extraTTYs = [cfg.ttyNumber];
|
2009-01-09 00:49:22 +01:00
|
|
|
|
2009-06-09 00:44:59 +02:00
|
|
|
services.extraJobs = pkgs.lib.singleton
|
|
|
|
{ name = "rogue";
|
2009-01-09 00:49:22 +01:00
|
|
|
|
|
|
|
job = ''
|
|
|
|
description "rogue game"
|
|
|
|
|
2009-06-09 00:44:59 +02:00
|
|
|
start on udev
|
|
|
|
stop on shutdown
|
|
|
|
respawn ${pkgs.rogue}/bin/rogue < /dev/tty${toString cfg.ttyNumber} > /dev/tty${toString cfg.ttyNumber} 2>&1
|
2009-01-09 00:49:22 +01:00
|
|
|
'';
|
|
|
|
};
|
2009-06-09 00:44:59 +02:00
|
|
|
|
|
|
|
services.ttyBackgrounds.specificThemes = pkgs.lib.singleton
|
|
|
|
{ tty = cfg.ttyNumber;
|
|
|
|
theme = pkgs.themes "theme-gnu";
|
2009-01-09 00:49:22 +01:00
|
|
|
};
|
2009-06-09 00:44:59 +02:00
|
|
|
|
|
|
|
services.mingetty.helpLine = "\nPress <Alt-F${toString cfg.ttyNumber}> to play Rogue.";
|
2009-01-09 00:49:22 +01:00
|
|
|
}
|