[Nix-dev] Would love to get feedback / help to a kodi problem

Matthew Bauer mjbauer95 at gmail.com
Sun May 7 04:37:30 CEST 2017


Stefan Huchler <stefan.huchler at mail.de> writes:

> Because I dont think that the nixos / nix documentation is very good
> (imho) and some experience with kodi packaging could help, I would be
> happy if somebody could help me get the plugin packaged.

This is definitely a struggle. The big issue is that Nix/Nixpkgs are
much more complicated than the average package manager. We probably have
/more/ documentation than RPM/DEB/Homebrew/etc. but we also have lots
more abstraction and hacks. It’s useful when you understand it but a
pain in the ass when it’s not working right.

> As far as I get it making a package for that plugin:
> https://github.com/xbmc/peripheral.joystick
>
> My first question for that would be: do I
> need to create a own package for that or do I have to modify the
> existing kodi package?

I don’t have Kodi setup but looking at the code you are probably going
to need to use it as plugin. You can follow the basic structure of
advanced-launcher for peripheral.joystick:

https://github.com/NixOS/nixpkgs/blob/52cb1df30c0413752a85a9fb01d48c1a3dba69ce/pkgs/applications/video/kodi/plugins.nix#L43-L71

That plugin will need to be referenced under wrapKodi in
all-packages.nix. I’d recommend call it "enablePeripheralJoystick":

https://github.com/NixOS/nixpkgs/blob/7d8a6ef1fddac18c2bdfd1d2552492c3598b14d0/pkgs/top-level/all-packages.nix#L15604-L15619

If you run into trouble definitely feel free to ask for help. Especially
on the #NixOS on freenode. Usually they can be really helpful.

To test it you will need to create ~/.nixpkgs/config.nix and put
something like this in it:

{
  kodi = {
    enablePeripheralJoystick = true;
    enableControllers = true; # might not be needed
  }
}

To build it, run:

nix-env -iA nixpkgs.kodi -f/home/user/path-to-nixpkgs/

Then kodi should be in your environment. Just run it with kodi if you
can. You’ll need to do some modifications to get it building under NixOS
but you’ll hopefully have a better handle on things. Make sure if you
get it working you submit a PR for it though! Don’t be afraid to ask for
help if you have issues.


More information about the nix-dev mailing list