arnaucube
arnaucube/configsPublic Self-hosted repository
configs/nixos/surface-extra-hardware-configuration.nix
nixos/surface-extra-hardware-configuration.nixRaw
 1# This is a custom file for a surface.
 2
 3{ config, lib, pkgs, modulesPath, ... }:
 4
 5{
 6  # Set an usable key configuration: Ctrl at capslock, Win at Alt, Alt at Ctrl
 7  services.xserver.displayManager.sessionCommands =''
 8    ${pkgs.xorg.xmodmap}/bin/xmodmap "${pkgs.writeText  "xkb-layout" ''
 9      !
10      ! Swap Caps_Lock and Control_L
11      !
12      
13	remove Lock = Caps_Lock
14	remove Control = Control_L
15	! keysym Control_L = Caps_Lock
16	keysym Control_L = Mode_switch
17	keysym Caps_Lock = Control_L
18	add Lock = Caps_Lock
19	add Control = Control_L
20
21	! map arrows to more ergonomic position
22	keycode  43 = h H Left
23	keycode  44 = j J Down
24	keycode  45 = k K Up 
25	keycode  46 = l L Right 
26    ''}"
27  '';
28
29
30  # add pulseaudio support to manage audio
31  hardware.pulseaudio.enable = true;
32}