From d0c6a1b4b49128dd20d4919c98616f0061cbc2ed Mon Sep 17 00:00:00 2001 From: sefidel Date: Tue, 22 Aug 2023 22:45:57 +0900 Subject: chore!: use keyd to manage key remaps --- home/profiles/gui/config/sway.nix | 2 +- modules/keyd-qol.nix | 36 ++++++++++++++++++++++++++++++++++++ nixos/alpha/configuration.nix | 2 ++ nixos/default.nix | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 modules/keyd-qol.nix diff --git a/home/profiles/gui/config/sway.nix b/home/profiles/gui/config/sway.nix index 3671ed3..174b47e 100644 --- a/home/profiles/gui/config/sway.nix +++ b/home/profiles/gui/config/sway.nix @@ -230,7 +230,7 @@ with neotheme.colors; repeat_delay 350 xkb_layout us # xkb_variant ,dvorak - xkb_options 'grp:alt_shift_toggle,caps:escape' + # xkb_options 'grp:alt_shift_toggle,caps:escape' # xkb_options ctrl:swapcaps } '' diff --git a/modules/keyd-qol.nix b/modules/keyd-qol.nix new file mode 100644 index 0000000..e163286 --- /dev/null +++ b/modules/keyd-qol.nix @@ -0,0 +1,36 @@ +{ config, pkgs, unstable, unstable-small, nixpkgs-2211, lib, ... }: + +{ + options.services.keyd-qol.enable = lib.mkEnableOption "keyd service for quality-of-life improvements"; + + config = lib.mkIf config.services.keyd-qol.enable { + services.keyd.enable = true; + + services.keyd.keyboards = { + default = { + ids = [ "*" ]; + settings = { + main = { + capslock = "overload(control, esc)"; + + insert = "S-insert"; + }; + }; + }; + + sun = { + ids = [ + # HHKB Hybrid + "04fe:0021" + ]; + settings = { + main = { + control = "overload(control, esc)"; + + insert = "S-insert"; + }; + }; + }; + }; + }; +} diff --git a/nixos/alpha/configuration.nix b/nixos/alpha/configuration.nix index ca69a37..2dbcb0a 100644 --- a/nixos/alpha/configuration.nix +++ b/nixos/alpha/configuration.nix @@ -162,6 +162,8 @@ hardware.bluetooth.enable = true; hardware.logitech.wireless.enable = true; + services.keyd-qol.enable = true; + services.udev.extraRules = '' # Logitech receiver for superlight, causes premature wakeup from suspend ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c547", ATTR{power/wakeup}="disabled" diff --git a/nixos/default.nix b/nixos/default.nix index ed40dad..86ab055 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -7,6 +7,7 @@ extraModules = [ ../modules/security.nix ../modules/cachix + ../modules/keyd-qol.nix inputs.sops-nix.nixosModules.sops ]; }; -- cgit 1.4.1