1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 17:25:11 +00:00
nixpkgs/modules/services/misc/rogue.nix
Eelco Dolstra 262ddf0854 * Move the manual/Rogue from virtual consoles 7/8 to 8/9
respectively so that the X server can run on 7.

svn path=/nixos/branches/modular-nixos/; revision=15924
2009-06-10 12:53:45 +00:00

60 lines
1.2 KiB
Nix

{pkgs, config, ...}:
# Show rogue game on tty9
# Originally used only by installation CD
let
inherit (pkgs.lib) mkOption;
options = {
services.rogue.enable = mkOption {
default = false;
description = ''
Whether to enable the Rogue game on one of the virtual
consoles.
'';
};
services.rogue.ttyNumber = mkOption {
default = "9";
description = ''
Virtual console on which to run Rogue.
'';
};
};
cfg = config.services.rogue;
in
pkgs.lib.mkIf cfg.enable {
require = [options];
boot.extraTTYs = [cfg.ttyNumber];
services.extraJobs = pkgs.lib.singleton
{ name = "rogue";
job = ''
description "Rogue dungeon crawling game"
start on udev
stop on shutdown
chdir /root
respawn ${pkgs.rogue}/bin/rogue < /dev/tty${toString cfg.ttyNumber} > /dev/tty${toString cfg.ttyNumber} 2>&1
'';
};
services.ttyBackgrounds.specificThemes = pkgs.lib.singleton
{ tty = cfg.ttyNumber;
theme = pkgs.themes "theme-gnu";
};
services.mingetty.helpLine = "\nPress <Alt-F${toString cfg.ttyNumber}> to play Rogue.";
}