diff --git a/system/options.nix b/system/options.nix index ae4c30c9c06..5971f10d20e 100644 --- a/system/options.nix +++ b/system/options.nix @@ -702,7 +702,23 @@ Event device for Synaptics touchpad. "; } - + + { + name = ["services" "xserver" "layout"]; + default = "us"; + description =" + Keyboard layout. + "; + } + + { + name = ["services" "xserver" "xkbOptions"]; + default = ""; + example = "grp:caps_toggle, grp_led:scroll"; + description =" + X keyboard options; layout switching goes here. + "; + } { diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index 58618a8fd9e..0a801217888 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -27,9 +27,10 @@ Section "InputDevice" Driver "kbd" Identifier "Keyboard[0]" Option "Protocol" "Standard" - Option "XkbLayout" "us" + Option "XkbLayout" "@layout@" Option "XkbModel" "pc104" Option "XkbRules" "xfree86" + @xkbOptions@ EndSection diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index ff4532b778f..d77d5c04f70 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -98,6 +98,11 @@ let Option \"TapButton3\" \"3\" EndSection " else ""); + xkbOptions = (if (getCfg "xkbOptions") == "" then "" else + " Option \"XkbOptions\" \""+(getCfg "xkbOptions")+"\""); + + layout = getCfg "layout"; + corePointer = (if getCfg "isSynaptics" then "Touchpad[0]" else "Mouse[0]");