Udev rules for a package

There is an application called Ledger Live that allows connecting and managing hardware wallets.
While troubleshooting, I found that they recommend updating udev rules via a bash script they provide.
Of course, their script won’t work because /etc/udev/rules.d links to nix store. And I know that there are ways to do it via configuration.nix.
But if those rules are necessary for the application to work, it kind of makes it feel natural to bundle it with the package. So every user of the package doesn’t need to troubleshoot. But that probably won’t fit into nixpkgs concept (or maybe it can, I am quite new to nix).
Maybe it should be extended into NixOS module? Or put a notice somewhere for the package user?
What is the recommended approach here?

Found hardware.ledger.enable option in NixOS. But still be nice to have some description in package. Maybe a wiki page with instructions to enable that option is the recommended approach here?

if a package contains udev rules in $out/{etc, lib}/udev You can load them using:

services.udev.packages = [ pkgs.ledger-live ];

It doesn’t, it contains them in separate repo. However, there is a separate package that only contains those udev rules which nixos option hardware.ledger.enable utilizes in the way you demonstrated above.
I was just wondering how things work, and how a user meant to find that option. I guess creating a wiki page is the best strategy here. Thanks for help anyway.

1 Like