I’m trying to run a script when a keyboard is plugged in. Here’s my approach
services.udev.extraRules = let kbd-udev = pkgs.stdenv.mkDerivation { ... }; in ''
ACTION=="add", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="2013", RUN+="${kbd-udev}/bin/kbd_udev", OWNER="philipp"
'';
Where the mkDerivation
just copies a shell script into the nix store.
This fails because
/nix/store/cjwyci23qb2h6k5ppa9wm69mwy80zksq-pmi-kbd-udev/bin/kbd_udev is called in udev rules but not installed by udev
What does this error mean to prevent, and how to I do this “the right way”?