[Nix-dev] Making additional kernel modules available for modprobe

Bjørn Forsman bjorn.forsman at gmail.com
Wed Jul 10 22:41:33 CEST 2013


Hi,

I'm working on packaging LTTng (Linux Trace Toolkit) for NixOS. I've
built the user space tools and the kernel modules, but I can't seem to
figure out how to make modprobe find the modules. I see that
virtualbox-guestadditions has got its modules (or a symlink to them)
in $MODULE_DIR/3.2.48/misc/. How do I do that for lttng-modules?

Also, lttng has a daemon that runs /sbin/modprobe to load lttng
modules. I see three alternatives:

1) s|/sbin/modprobe|modprobe|
2) s|/sbin/modprobe|${module_init_tools}|
3) s|/sbin/modprobe|${config.system.sbin.modprobe}|

There are nix expressions that use option 1 and 2. I don't like option
1 because it has modprobe as an unspecified dependency. Option 2 is
better, but module-init-tools is deprecated, right? Option 3,
system.sbin.modprobe, a wrapper around modprobe from kmod. That seemed
the best to me. But I couldn't make it build. I added 'config' as
input to my nixpkgs expression and tried to use
${config.system.sbin.modprobe} inside the expression/derivation. Then
I got "attribute `system.sbin.modprobe' missing" error.

I guess the config attribute in nixpkgs is for *nixpkgs* and not for
*nixos*? Or am I missing something?

Any suggestions?

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list