Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NixOS Module evremap #362661

Merged
merged 7 commits into from
Dec 22, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions nixos/modules/services/misc/evremap.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let
cfg = config.services.evremap;
format = pkgs.formats.toml { };

key = lib.types.strMatching "KEY_[[:upper:]]+" // {
description = "key ID prefixed with KEY_";
key = lib.types.strMatching "(BTN|KEY)_[[:upper:]]+" // {
description = "key ID prefixed with BTN_ or KEY_";
};

mkKeyOption =
Expand Down Expand Up @@ -63,6 +63,18 @@ in
'';
};

phys = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "usb-0000:07:00.3-2.1.1/input0";
description = ''
If you have multiple devices with the same name, you can optionally
specify this attribute.

If available, the value will be printed when running `evremap list-devices` with elevated permissions.
pixL404 marked this conversation as resolved.
Show resolved Hide resolved
'';
};

dual_role = lib.mkOption {
type = lib.types.listOf dualRoleModule;
default = [ ];
Expand Down Expand Up @@ -117,7 +129,9 @@ in
description = "evremap - keyboard input remapper";
wantedBy = [ "multi-user.target" ];

script = "${lib.getExe pkgs.evremap} remap ${format.generate "evremap.toml" cfg.settings}";
script = "${lib.getExe pkgs.evremap} remap ${
format.generate "evremap.toml" (lib.attrsets.filterAttrs (n: v: v != null) cfg.settings)
pixL404 marked this conversation as resolved.
Show resolved Hide resolved
}";

serviceConfig = {
DynamicUser = true;
Expand Down
Loading