From b7cad3c059d9d21f15297dda3245443f9defabce Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 8 Jun 2009 22:44:59 +0000 Subject: [PATCH] * Style fix. svn path=/nixos/branches/modular-nixos/; revision=15896 --- modules/services/misc/rogue.nix | 40 +++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/modules/services/misc/rogue.nix b/modules/services/misc/rogue.nix index 0306033adc0b..ddda413727a8 100644 --- a/modules/services/misc/rogue.nix +++ b/modules/services/misc/rogue.nix @@ -24,41 +24,31 @@ let }; }; -inherit (pkgs.lib) optional; - -inherit (config.services.rogue) enable ttyNumber; + cfg = config.services.rogue; in -{ - require = [ - options - ]; +pkgs.lib.mkIf cfg.enable { + require = [options]; - boot = { - extraTTYs = optional enable ttyNumber; - }; + boot.extraTTYs = [cfg.ttyNumber]; - services = { - extraJobs = optional enable { - name = "rogue"; + services.extraJobs = pkgs.lib.singleton + { 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 + start on udev + stop on shutdown + respawn ${pkgs.rogue}/bin/rogue < /dev/tty${toString cfg.ttyNumber} > /dev/tty${toString cfg.ttyNumber} 2>&1 ''; }; - ttyBackgrounds = { - specificThemes = optional enable { - tty = ttyNumber; - theme = pkgs.themes "theme-gnu"; - }; + + services.ttyBackgrounds.specificThemes = pkgs.lib.singleton + { tty = cfg.ttyNumber; + theme = pkgs.themes "theme-gnu"; }; - mingetty = { - helpLine = if enable then "\nPress to play rogue." else ""; - }; - }; + + services.mingetty.helpLine = "\nPress to play Rogue."; }