about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-08-22 22:45:57 +0900
committersefidel <contact@sefidel.net>2023-08-22 22:45:57 +0900
commitd0c6a1b4b49128dd20d4919c98616f0061cbc2ed (patch)
tree785b2230cec01e9392a1a3b097ae7dec0d2ffe57
parentffb90b9e874e4cca5ea03c4c9f242b5c7dba6d1c (diff)
downloadnixrc-d0c6a1b4b49128dd20d4919c98616f0061cbc2ed.tar.gz
nixrc-d0c6a1b4b49128dd20d4919c98616f0061cbc2ed.zip
chore!: use keyd to manage key remaps
-rw-r--r--home/profiles/gui/config/sway.nix2
-rw-r--r--modules/keyd-qol.nix36
-rw-r--r--nixos/alpha/configuration.nix2
-rw-r--r--nixos/default.nix1
4 files changed, 40 insertions, 1 deletions
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
     ];
   };