diff --git a/system/options.nix b/system/options.nix index f8f07bb4b2fc..67ed93fb30f3 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2246,6 +2246,7 @@ in (import ../upstart-jobs/fcron.nix) (import ../upstart-jobs/cron/locate.nix) (import ../upstart-jobs/manual.nix) + (import ../upstart-jobs/rogue.nix) # fonts (import ../system/fonts.nix) diff --git a/upstart-jobs/rogue.nix b/upstart-jobs/rogue.nix new file mode 100644 index 000000000000..75b1a0a98820 --- /dev/null +++ b/upstart-jobs/rogue.nix @@ -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 to play rogue." else ""; + }; + }; +}