about summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-11-13 06:01:46 +0000
committerGitHub <noreply@github.com>2022-11-13 06:01:46 +0000
commit22f9a6207086fc630944a50bdeae0013f200b6ea (patch)
tree15cac136eab93e105ff880c676d0d016b4764dfd /nixos/modules/config
parent5214d81075690507739653e4da8cbed43fb753b1 (diff)
parenta49b971934587506c3c9b766fbcd629df44b20c6 (diff)
Merge staging-next into staging
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/console.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/nixos/modules/config/console.nix b/nixos/modules/config/console.nix
index 1f8f80a554d0b..f5db5dc5dfc11 100644
--- a/nixos/modules/config/console.nix
+++ b/nixos/modules/config/console.nix
@@ -34,14 +34,16 @@ let
       "/share/unimaps"
     ];
   };
-
-  setVconsole = !config.boot.isContainer;
 in
 
 {
   ###### interface
 
   options.console  = {
+    enable = mkEnableOption (lib.mdDoc "virtual console") // {
+      default = true;
+    };
+
     font = mkOption {
       type = with types; either str path;
       default = "Lat2-Terminus16";
@@ -125,11 +127,17 @@ in
           '');
     }
 
-    (mkIf (!setVconsole) {
-      systemd.services.systemd-vconsole-setup.enable = false;
+    (mkIf (!cfg.enable) {
+      systemd.services = {
+        "serial-getty@ttyS0".enable = false;
+        "serial-getty@hvc0".enable = false;
+        "getty@tty1".enable = false;
+        "autovt@".enable = false;
+        systemd-vconsole-setup.enable = false;
+      };
     })
 
-    (mkIf setVconsole (mkMerge [
+    (mkIf cfg.enable (mkMerge [
       { environment.systemPackages = [ pkgs.kbd ];
 
         # Let systemd-vconsole-setup.service do the work of setting up the