nixos i18n: add option to set console keymap from xkb
Close #9675. The expression was refactored heavily by vcunat.
This commit is contained in:
parent
87012187b2
commit
9d3da3a3bf
|
@ -52,6 +52,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
consoleUseXkbConfig = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
If set, configure the console keymap from the xserver keyboard
|
||||
settings.
|
||||
'';
|
||||
};
|
||||
|
||||
consoleKeyMap = mkOption {
|
||||
type = mkOptionType {
|
||||
name = "string or path";
|
||||
|
@ -74,6 +83,13 @@ in
|
|||
|
||||
config = {
|
||||
|
||||
i18n.consoleKeyMap = with config.services.xserver;
|
||||
mkIf config.i18n.consoleUseXkbConfig
|
||||
(pkgs.runCommand "xkb-console-keymap" { preferLocalBuild = true; } ''
|
||||
'${pkgs.ckbcomp}/bin/ckbcomp' -model '${xkbModel}' -layout '${layout}' \
|
||||
-option '${xkbOptions}' -variant '${xkbVariant}' > "$out"
|
||||
'');
|
||||
|
||||
environment.systemPackages =
|
||||
optional (config.i18n.supportedLocales != []) glibcLocales;
|
||||
|
||||
|
|
Loading…
Reference in New Issue