{ config, pkgs, lib, ... }: let cfg = config.local.keyboard; in { options.local.keyboard = with lib; { enable = mkEnableOption "base keyboard configuration"; lan-mouse.enable = mkEnableOption "a software KVM switch for sharing a mouse and keyboard with multiple hosts through the network"; }; config = lib.mkIf cfg.enable { environment.systemPackages = lib.optional cfg.lan-mouse.enable pkgs.unstable.lan-mouse; services.xserver = { xkbModel = "pc105"; layout = "us,us"; xkbVariant = "dvorak,"; xkbOptions = "grp:win_space_toggle"; }; console.useXkbConfig = true; }; }