diff --git a/modules/config/i18n.nix b/modules/config/i18n.nix index dd435d481b7..e964b9bfb1d 100644 --- a/modules/config/i18n.nix +++ b/modules/config/i18n.nix @@ -47,11 +47,11 @@ let The keyboard mapping table for the virtual consoles. "; }; - + }; - + }; - + ###### implementation glibcLocales = pkgs.glibcLocales.override { diff --git a/modules/system/boot/systemd.nix b/modules/system/boot/systemd.nix index 66cc048d9c0..dc0c2ba4504 100644 --- a/modules/system/boot/systemd.nix +++ b/modules/system/boot/systemd.nix @@ -45,7 +45,7 @@ let # Login stuff. "systemd-logind.service" "autovt@.service" - "systemd-vconsole-setup.service" + #"systemd-vconsole-setup.service" "systemd-user-sessions.service" "dbus-org.freedesktop.login1.service" "user@.service" diff --git a/modules/tasks/kbd.nix b/modules/tasks/kbd.nix index aa708fb6019..7867b3c1912 100644 --- a/modules/tasks/kbd.nix +++ b/modules/tasks/kbd.nix @@ -13,6 +13,12 @@ let consoleFont = config.i18n.consoleFont; consoleKeyMap = config.i18n.consoleKeyMap; + vconsoleConf = pkgs.writeText "vconsole.conf" + '' + KEYMAP=${consoleKeyMap} + FONT=${consoleFont} + ''; + in { @@ -61,11 +67,27 @@ in # systemd-vconsole-setup.service if /etc/vconsole.conf changes. environment.etc = singleton { target = "vconsole.conf"; - source = pkgs.writeText "vconsole.conf" - '' - KEYMAP=${consoleKeyMap} - FONT=${consoleFont} - ''; + source = vconsoleConf; + }; + + # This is identical to the systemd-vconsole-setup.service unit + # shipped with systemd, except that it uses /dev/tty1 instead of + # /dev/tty0 to prevent putting the X server in non-raw mode, and + # it has a restart trigger. + boot.systemd.services."systemd-vconsole-setup" = + { description = "Setup Virtual Console"; + before = [ "sysinit.target" "shutdown.target" ]; + unitConfig = + { DefaultDependencies = "no"; + Conflicts = "shutdown.target"; + ConditionPathExists = "/dev/tty1"; + }; + serviceConfig = + { Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${config.system.build.systemd}/lib/systemd/systemd-vconsole-setup /dev/tty1"; + }; + restartTriggers = [ vconsoleConf ]; }; };