3
0
Fork 0
forked from mirrors/nixpkgs

systemd-vconsole-setup: Don't put the X server in non-raw mode

‘systemd-vconsole-setup’ by default operates on /dev/tty0, the
currently active tty.  Since it puts /dev/tty0 in Unicode or ASCII
mode, if the X server is currently active when it runs, keys such as
Alt-F4 won't reach the X server anymore.  So use /dev/tty1 instead.
This commit is contained in:
Eelco Dolstra 2012-10-18 11:54:07 -04:00
parent a4cad32c3d
commit b4a1893cdd
3 changed files with 31 additions and 9 deletions

View file

@ -47,11 +47,11 @@ let
The keyboard mapping table for the virtual consoles.
";
};
};
};
###### implementation
glibcLocales = pkgs.glibcLocales.override {

View file

@ -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"

View file

@ -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 ];
};
};