summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--configuration.nix1
-rw-r--r--files/neoqwertz.xkb91
-rw-r--r--keyboard.nix26
3 files changed, 118 insertions, 0 deletions
diff --git a/configuration.nix b/configuration.nix
index 7a5df46..26c138e 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -14,6 +14,7 @@
       ./cups.nix
       ./args.nix
       ./zsh.nix
+      ./keyboard.nix
     ];
     system.stateVersion = "23.05";
 }
diff --git a/files/neoqwertz.xkb b/files/neoqwertz.xkb
new file mode 100644
index 0000000..40de951
--- /dev/null
+++ b/files/neoqwertz.xkb
@@ -0,0 +1,91 @@
+// NEOQWERTZ keyboard layout
+//
+// (c) 2016 by Andreas Hofmann <mail@andreas-hofmann.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+xkb_keymap {
+  xkb_keycodes  { include "evdev+aliases(qwertz)" };
+  xkb_types     { include "complete" };
+  xkb_compat    { include "complete" };
+  partial alphanumeric_keys modifier_keys keypad_keys
+  xkb_symbols   {
+    include "inet(evdev)"
+    include "pc"
+
+    include "de(neo_base)"
+    name[Group1]="German (eliminate dead keys with advanced NEO layers)";
+
+    key <TLDE> { [ asciicircum,            degree          ] };
+    key <AE01> { [ 1,                      exclam          ] };
+    key <AE02> { [ 2,                      quotedbl        ] };
+    key <AE03> { [ 3,                      section         ] };
+    key <AE04> { [ 4,                      dollar          ] };
+    key <AE05> { [ 5,                      percent         ] };
+    key <AE06> { [ 6,                      ampersand       ] };
+    key <AE07> { [ 7,                      slash           ],           [ braceleft    ] };
+    key <AE08> { [ 8,                      parenleft       ],           [ bracketleft  ] };
+    key <AE09> { [ 9,                      parenright      ],           [ bracketright ] };
+    key <AE10> { [ 0,                      equal           ],           [ braceright   ] };
+    key <AE11> { [ ssharp,                 question        ],           [ backslash    ] };
+    key <AE12> { [ acute,                  grave           ] };
+
+    key <AD01> { [ q,                      Q               ],           [ at           ] };
+    key <AD02> { [ w,                      W               ],           [ NoSymbol     ] };
+    key <AD03> { [ e,                      E               ],           [ EuroSign     ] };
+    key <AD04> { [ r,                      R               ],           [ NoSymbol     ] };
+    key <AD05> { [ t,                      T               ] };
+    key <AD06> { [ z,                      Z               ] };
+    key <AD07> { [ u,                      U               ] };
+    key <AD08> { [ i,                      I               ] };
+    key <AD09> { [ o,                      O               ] };
+    key <AD10> { [ p,                      P               ] };
+    key <AD11> { [ udiaeresis,             Udiaeresis      ] };
+    key <AC01> { [ a,                      A               ] };
+    key <AC02> { [ s,                      S               ] };
+    key <AC03> { [ d,                      D               ] };
+    key <AC04> { [ f,                      F               ] };
+    key <AC05> { [ g,                      G               ] };
+    key <AC06> { [ h,                      H               ] };
+    key <AC07> { [ j,                      J               ] };
+    key <AC08> { [ k,                      K               ] };
+    key <AC09> { [ l,                      L               ] };
+    key <AC10> { [ odiaeresis,             Odiaeresis      ] };
+    key <AC11> { [ adiaeresis,             Adiaeresis      ] };
+    key <AB01> { [ y,                      Y               ] };
+    key <AB02> { [ x,                      X               ] };
+    key <AB03> { [ c,                      C               ] };
+    key <AB04> { [ v,                      V               ] };
+    key <AB05> { [ b,                      B               ] };
+    key <AB06> { [ n,                      N               ] };
+    key <AB07> { [ m,                      M               ] };
+
+    key <AB08> { [ comma,                  semicolon       ] };
+    key <AB09> { [ period,                 colon           ] };
+    key <AB10> { [ minus,                  underscore      ] };
+    key <AD12> { [ plus,                   asterisk        ],           [ asciitilde   ] };
+
+    include "shift(both_capslock)"
+    include "level3(caps_switch)"
+    include "level3(bksl_switch)"
+    include "level5(lsgt_switch)"
+    include "level5(ralt_switch)"
+
+    modifier_map Control{ Control_L };
+
+    key.type = "ONE_LEVEL";
+    key <RCTL> { [ ISO_Group_Latch ] };
+  };
+  xkb_geometry  { include "pc(pc105)" };
+};
diff --git a/keyboard.nix b/keyboard.nix
new file mode 100644
index 0000000..be64815
--- /dev/null
+++ b/keyboard.nix
@@ -0,0 +1,26 @@
+{ config, pkgs, ... }:
+	
+	let
+	  compiledLayout = pkgs.runCommand "keyboard-layout" {} ''
+	    ${pkgs.xorg.xkbcomp}/bin/xkbcomp ${./files/neoqwertz.xkb} $out
+	  '';
+	in
+{
+	#services.xserver = {
+  	#	layout = "de, de";
+  	#	xkbVariant = ",neo";
+  	#	xkbOptions = "grp:win_space_toggle";
+	#};
+
+	  environment.systemPackages = [ pkgs.xorg.xkbcomp ];
+	  services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xkbcomp}/bin/xkbcomp ${compiledLayout} $DISPLAY";
+
+	i18n.defaultLocale = "en_US.UTF-8";
+
+   	console = {
+     		font = "Lat2-Terminus16";
+     		#keyMap = "de";
+     		useXkbConfig = true; # use xkbOptions in tty.
+   	};
+}
+