From 9c6cd2b9038cabc9643b40b250d7df49540a0054 Mon Sep 17 00:00:00 2001 From: Ray Andrew Date: Mon, 3 Mar 2025 23:13:16 -0600 Subject: [PATCH] add ids in keyd --- hosts/pickwick/default.nix | 9 +++++++- nixos/keyd.nix | 43 +++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/hosts/pickwick/default.nix b/hosts/pickwick/default.nix index e599796..592160f 100644 --- a/hosts/pickwick/default.nix +++ b/hosts/pickwick/default.nix @@ -17,7 +17,14 @@ ]; custom = { - keyd.enable = true; + keyd = { + enable = true; + ids = [ + "0001:0001:70533846" # framework + "3434:06a0:d7dfbeabt" # keychron q10 + "046d:c339:9f276ca6" # Logitech Pro + ]; + }; displaymanager.enable = true; _1password.enable = true; audio.enable = true; diff --git a/nixos/keyd.nix b/nixos/keyd.nix index 331ec7c..c2ff195 100644 --- a/nixos/keyd.nix +++ b/nixos/keyd.nix @@ -4,23 +4,20 @@ pkgs, ... }: -let - commonSettings = { - main = { - capslock = "layer(capslock)"; - insert = "S-insert"; - }; - meta = { - w = "macro(C-w)"; - a = "macro(C-a)"; - }; - "capslock:C" = { }; - }; -in { options.custom = with lib; { keyd = { enable = mkEnableOption "Enable keyd"; + ids = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ + "0001:0001:70533846" + "3434:06a0:d7dfbeabt" + "046d:c339:9f276ca6" + ]; + description = "List of keyboard is that will be configured"; + }; }; }; @@ -31,7 +28,19 @@ in ]; users.groups.keyd = { }; - services.keyd = { + services.keyd = let + commonSettings = { + main = { + capslock = "layer(capslock)"; + insert = "S-insert"; + }; + meta = { + w = "macro(C-w)"; + a = "macro(C-a)"; + }; + "capslock:C" = { }; + }; + in { enable = true; keyboards = { default = { @@ -39,11 +48,7 @@ in settings = commonSettings; }; workstation = { - ids = [ - "0001:0001:70533846" # framework - "3434:06a0:d7dfbeabt" # keychron q10 - "046d:c339:9f276ca6" # Logitech Pro - ]; + ids = config.custom.keyd.ids; settings = lib.mkMerge [ commonSettings {