add ids in keyd

This commit is contained in:
Ray Andrew 2025-03-03 23:13:16 -06:00
parent 6dfd55b17f
commit 9c6cd2b903
No known key found for this signature in database
2 changed files with 32 additions and 20 deletions

View file

@ -17,7 +17,14 @@
]; ];
custom = { 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; displaymanager.enable = true;
_1password.enable = true; _1password.enable = true;
audio.enable = true; audio.enable = true;

View file

@ -4,7 +4,31 @@
pkgs, pkgs,
... ...
}: }:
let {
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";
};
};
};
config = lib.mkIf config.custom.keyd.enable {
environment.systemPackages = with pkgs; [
keyd
];
users.groups.keyd = { };
services.keyd = let
commonSettings = { commonSettings = {
main = { main = {
capslock = "layer(capslock)"; capslock = "layer(capslock)";
@ -16,22 +40,7 @@ let
}; };
"capslock:C" = { }; "capslock:C" = { };
}; };
in in {
{
options.custom = with lib; {
keyd = {
enable = mkEnableOption "Enable keyd";
};
};
config = lib.mkIf config.custom.keyd.enable {
environment.systemPackages = with pkgs; [
keyd
];
users.groups.keyd = { };
services.keyd = {
enable = true; enable = true;
keyboards = { keyboards = {
default = { default = {
@ -39,11 +48,7 @@ in
settings = commonSettings; settings = commonSettings;
}; };
workstation = { workstation = {
ids = [ ids = config.custom.keyd.ids;
"0001:0001:70533846" # framework
"3434:06a0:d7dfbeabt" # keychron q10
"046d:c339:9f276ca6" # Logitech Pro
];
settings = lib.mkMerge [ settings = lib.mkMerge [
commonSettings commonSettings
{ {