From aebf9a4709215c230e5841d60e2bce6aa6627ac8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Mar 2020 10:29:12 +0100 Subject: [PATCH 1/2] services/misc/nixos-manual.nix: Remove Running the manual on a TTY is useless in the graphical ISOs and not particularly useful in non-graphical ISOs (since you can also run 'nixos-help'). Fixes #83157. --- nixos/doc/manual/installation/installing.xml | 3 +- nixos/modules/misc/documentation.nix | 4 +- nixos/modules/module-list.nix | 1 - .../modules/profiles/installation-device.nix | 1 - nixos/modules/services/misc/nixos-manual.nix | 73 ------------------- 5 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 nixos/modules/services/misc/nixos-manual.nix diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml index 4041b4ad163a..0dbfb39c32b2 100644 --- a/nixos/doc/manual/installation/installing.xml +++ b/nixos/doc/manual/installation/installing.xml @@ -24,8 +24,7 @@ - The NixOS manual is available on virtual console 8 (press Alt+F8 to access) - or by running nixos-help. + The NixOS manual is available by running nixos-help. diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 7b3f9c0fe9cd..7ad4be9a02e6 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -218,9 +218,7 @@ in ++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ]); services.mingetty.helpLine = mkIf cfg.doc.enable ( - "\nRun `nixos-help` " - + optionalString config.services.nixosManual.showManual "or press " - + "for the NixOS manual." + "\nRun 'nixos-help' for the NixOS manual." ); }) diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ccdc39eecd8d..6ef915152b29 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -469,7 +469,6 @@ ./services/misc/nix-daemon.nix ./services/misc/nix-gc.nix ./services/misc/nix-optimise.nix - ./services/misc/nixos-manual.nix ./services/misc/nix-ssh-serve.nix ./services/misc/novacomd.nix ./services/misc/nzbget.nix diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix index 4596e163404c..06008d8a5e72 100644 --- a/nixos/modules/profiles/installation-device.nix +++ b/nixos/modules/profiles/installation-device.nix @@ -26,7 +26,6 @@ with lib; # Show the manual. documentation.nixos.enable = mkForce true; - services.nixosManual.showManual = true; # Let the user play Rogue on TTY 8 during the installation. #services.rogue.enable = true; diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix deleted file mode 100644 index ab73f49d4be5..000000000000 --- a/nixos/modules/services/misc/nixos-manual.nix +++ /dev/null @@ -1,73 +0,0 @@ -# This module optionally starts a browser that shows the NixOS manual -# on one of the virtual consoles which is useful for the installation -# CD. - -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.services.nixosManual; - cfgd = config.documentation; -in - -{ - - options = { - - # TODO(@oxij): rename this to `.enable` eventually. - services.nixosManual.showManual = mkOption { - type = types.bool; - default = false; - description = '' - Whether to show the NixOS manual on one of the virtual - consoles. - ''; - }; - - services.nixosManual.ttyNumber = mkOption { - type = types.int; - default = 8; - description = '' - Virtual console on which to show the manual. - ''; - }; - - services.nixosManual.browser = mkOption { - type = types.path; - default = "${pkgs.w3m-nographics}/bin/w3m"; - description = '' - Browser used to show the manual. - ''; - }; - - }; - - - config = mkMerge [ - (mkIf cfg.showManual { - assertions = singleton { - assertion = cfgd.enable && cfgd.nixos.enable; - message = "Can't enable `services.nixosManual.showManual` without `documentation.nixos.enable`"; - }; - }) - (mkIf (cfg.showManual && cfgd.enable && cfgd.nixos.enable) { - console.extraTTYs = [ "tty${toString cfg.ttyNumber}" ]; - - systemd.services.nixos-manual = { - description = "NixOS Manual"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "${cfg.browser} ${config.system.build.manual.manualHTMLIndex}"; - StandardInput = "tty"; - StandardOutput = "tty"; - TTYPath = "/dev/tty${toString cfg.ttyNumber}"; - TTYReset = true; - TTYVTDisallocate = true; - Restart = "always"; - }; - }; - }) - ]; - -} From bd379be53835959c02b2967e28b57a69c06a85aa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Mar 2020 10:30:46 +0100 Subject: [PATCH 2/2] Remove unused 'rogue' service --- nixos/modules/module-list.nix | 1 - .../modules/profiles/installation-device.nix | 3 - nixos/modules/services/misc/rogue.nix | 62 ------------------- 3 files changed, 66 deletions(-) delete mode 100644 nixos/modules/services/misc/rogue.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6ef915152b29..8c7f5e39a3bd 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -484,7 +484,6 @@ ./services/misc/redmine.nix ./services/misc/rippled.nix ./services/misc/ripple-data-api.nix - ./services/misc/rogue.nix ./services/misc/serviio.nix ./services/misc/safeeyes.nix ./services/misc/sickbeard.nix diff --git a/nixos/modules/profiles/installation-device.nix b/nixos/modules/profiles/installation-device.nix index 06008d8a5e72..d05c0c50e82c 100644 --- a/nixos/modules/profiles/installation-device.nix +++ b/nixos/modules/profiles/installation-device.nix @@ -27,9 +27,6 @@ with lib; # Show the manual. documentation.nixos.enable = mkForce true; - # Let the user play Rogue on TTY 8 during the installation. - #services.rogue.enable = true; - # Use less privileged nixos user users.users.nixos = { isNormalUser = true; diff --git a/nixos/modules/services/misc/rogue.nix b/nixos/modules/services/misc/rogue.nix deleted file mode 100644 index d56d103b5f34..000000000000 --- a/nixos/modules/services/misc/rogue.nix +++ /dev/null @@ -1,62 +0,0 @@ -# Execute the game `rogue' on tty 9. Mostly used by the NixOS -# installation CD. - -{ config, lib, pkgs, ... }: - -with lib; - -let - - cfg = config.services.rogue; - -in - -{ - ###### interface - - options = { - - services.rogue.enable = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable the Rogue game on one of the virtual - consoles. - ''; - }; - - services.rogue.tty = mkOption { - type = types.str; - default = "tty9"; - description = '' - Virtual console on which to run Rogue. - ''; - }; - - }; - - - ###### implementation - - config = mkIf cfg.enable { - - console.extraTTYs = [ cfg.tty ]; - - systemd.services.rogue = - { description = "Rogue dungeon crawling game"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = - { ExecStart = "${pkgs.rogue}/bin/rogue"; - StandardInput = "tty"; - StandardOutput = "tty"; - TTYPath = "/dev/${cfg.tty}"; - TTYReset = true; - TTYVTDisallocate = true; - WorkingDirectory = "/tmp"; - Restart = "always"; - }; - }; - - }; - -}