Out of tree kernel modules (xpad)?

I’m trying to install xpad but can’t get it to compile. Not imperatively by just cloning and running make or in a nix derivation. The intended way of building is through dkms (somehow?) but we don’t have that.

Does anyone already have a derivation I can copy or can provide help with this?

I would start from another kernel module like nixpkgs/default.nix at b2aeb9072b698553c2332e6bd6128eb0dce5e9ee · NixOS/nixpkgs · GitHub

That’s what I did with no luck, but this one looks entirely different and the repo structure looks more similar to xpad, so I’ll try that

Now I (according to reddit at least) need a udev rule with access to coreutils’ echo.

I can’t get that to work now. Despite coretutils being in buildInputs it gets rejected.

My wip package

Never mind, I was being stupid and forgetting the $ in ${pkgs.foo}

For anyone finding this thread trying to get the 8Bitdo Ultimate Wireless Bluetooth working on NixOS, I’m not gonna leave you like DenverCode9. I haven’t tried reducing this to what’s the bare minimum, but here’s my current setup:

Module setup in configuration.nix
udev rules in configuration.nix