summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-02-16 16:46:30 +0300
committerNikolay Amiantov <ab@fmap.me>2017-02-16 17:08:14 +0300
commit0c81594a29d99d9ee9c9c88c680340d56823cfb2 (patch)
tree2b387f6f75a376db11bd469b3cfe125f52c2aa54 /nixos/modules/tasks
parent109ee2a338eeff0d6be820e2caa2950922124cf1 (diff)
downloadnixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar.gz
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar.bz2
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar.lz
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar.xz
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.tar.zst
nixlib-0c81594a29d99d9ee9c9c88c680340d56823cfb2.zip
kbd service: use /dev/tty1 for systemd-vconsole-setup
Fixes #22470
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/kbd.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/tasks/kbd.nix b/nixos/modules/tasks/kbd.nix
index 4aa4c7d22ac2..3975dd5b0ffd 100644
--- a/nixos/modules/tasks/kbd.nix
+++ b/nixos/modules/tasks/kbd.nix
@@ -98,12 +98,22 @@ in
           '') config.i18n.consoleColors}
         '';
 
+        /* XXX: systemd-vconsole-setup needs a "main" terminal. By default
+         * /dev/tty0 is used which wouldn't work when the service is restarted
+         * from X11. We set this to /dev/tty1; not ideal because it may also be
+         * owned by X11 or something else.
+         *
+         * See #22470.
+         */
         systemd.services."systemd-vconsole-setup" =
           { wantedBy = [ "sysinit.target" ];
             before = [ "display-manager.service" ];
             after = [ "systemd-udev-settle.service" ];
             restartTriggers = [ vconsoleConf kbdEnv ];
-            restartIfChanged = false; # fails when tty is inactive
+            serviceConfig.ExecStart = [
+              ""
+              "${pkgs.systemd}/lib/systemd/systemd-vconsole-setup /dev/tty1"
+            ];
           };
       }