···55 cfg = config.hardware.keyboard.zsa;
66in
77{
88- # TODO: make group configurable like in https://github.com/NixOS/nixpkgs/blob/0b2b4b8c4e729535a61db56468809c5c2d3d175c/pkgs/tools/security/nitrokey-app/udev-rules.nix ?
98 options.hardware.keyboard.zsa = {
109 enable = mkOption {
1110 type = types.bool;
···1413 Enables udev rules for keyboards from ZSA like the ErgoDox EZ, Planck EZ and Moonlander Mark I.
1514 You need it when you want to flash a new configuration on the keyboard
1615 or use their live training in the browser.
1717- Access to the keyboard is granted to users in the "plugdev" group.
1816 You may want to install the wally-cli package.
1917 '';
2018 };
···22202321 config = mkIf cfg.enable {
2422 services.udev.packages = [ pkgs.zsa-udev-rules ];
2525- users.groups.plugdev = {};
2623 };
2724}
+5-6
pkgs/os-specific/linux/zsa-udev-rules/default.nix
···11{ lib, stdenv, fetchFromGitHub }:
2233-stdenv.mkDerivation {
33+stdenv.mkDerivation rec {
44 pname = "zsa-udev-rules";
55- version = "unstable-2020-12-16";
55+ version = "2.1.3";
6677- # TODO: use version and source from nixpkgs/pkgs/development/tools/wally-cli/default.nix after next release
87 src = fetchFromGitHub {
98 owner = "zsa";
109 repo = "wally";
1111- rev = "e5dde3c700beab39fb941c6941e55535bf9b2af6";
1212- sha256 = "0pkybi32r1hrmpa1mc8qlzhv7xy5n5rr5ah25lbr0cipp1bda417";
1010+ rev = "${version}-linux";
1111+ sha256 = "mZzXKFKlO/jAitnqzfvmIHp46A+R3xt2gOhVC3qN6gM=";
1312 };
14131515- # it only installs files
1414+ # Only copies udevs rules
1615 dontConfigure = true;
1716 dontBuild = true;
1817 dontFixup = true;