configs/nixos/extra-hardware-configuration.nix
nixos/extra-hardware-configuration.nixRaw
1# This is a custom file for a chromebook.
2
3{ config, lib, pkgs, modulesPath, ... }:
4
5{
6 services.logind.extraConfig = ''
7 # disable power button. This is for the chromebook
8 HandlePowerKey=ignore
9 '';
10
11 # Set an usable key configuration: Ctrl at capslock, Win at Alt, Alt at Ctrl
12 services.xserver.displayManager.sessionCommands =''
13 ${pkgs.xorg.xmodmap}/bin/xmodmap "${pkgs.writeText "xkb-layout" ''
14 !
15 ! Swap Caps_Lock and Control_L
16 !
17
18 remove control = Control_L
19 remove mod1 = Alt_L
20 remove mod4 = Super_L
21
22 keysym Control_L = Alt_L
23 keysym Super_L = Control_L
24 keysym Alt_L = Super_L
25
26 add control = Control_L
27 add mod1 = Alt_L
28 add mod4 = Super_L
29 ''}"
30 '';
31}