Nixpkgs: hid_apple kernel module parameters not working

Created on 5 Dec 2016  路  12Comments  路  Source: NixOS/nixpkgs

Issue description

I have nixos 16.09 installed on my macbook pro retina, and I would like to fix a few keyboard mapping issues by setting the fnmode and iso_layout parameters for the hid_apple kernel module (as described here).

When I set the parameters in my configuration.nix and rebuild and reboot, the mappings have not changed, and the value of the parameters does not appear to have changed either.

The values are written to /etc/modprobe.d/nixos.conf but are not propagated to /sys/module/hid_apple/parameters.

Full output of all the tools that I could think to run in this gist

Steps to reproduce

  1. Add the following lines to /etc/nixos/configuration.nix:
  boot.extraModprobeConfig = ''
    options hid_apple fnmode=2
    options hid_apple iso_layout=0
  '';
  1. sudo nixos-rebuild switch && reboot

Expected

  1. module parameters at /sys/module/hid_apple/parameters/ have been updated to the values set in configuration.nix

Actual

  1. module parameters are not the same as those set in configuration.nix. fnmode and iso_layout are set to 1.

Technical details

  • System: NixOS: 16.09
  • Nix version: nix-env (Nix) 1.11.4
  • Nixpkgs version: 16.09.1198.6a9f087
stale kernel nixos

Most helpful comment

As a workaround I did like https://gist.github.com/dmjio/3679898135b25fa49723 and passed module options using the bootloader kernel params

boot.kernelParams = [
  "hid_apple.fnmode=2"
];

All 12 comments

Just to check the obvious, you have either rebooted or unloaded/loaded the module after making the change?

Hi :relaxed:

I have rebooted multiple times, and the issue still persists. If I manually unload the module (modprobe -r hid_apple) the keyboard stops working so I can't load it again without a reboot.

I'll take a look tonight - I have an apple keyboard at home.

Figured out how to manually unload / load the module (sudo modprobe -r hid_apple && sudo modprobe hid_apple).

After running this command the keyboard mappings are correct, and the module parameters are applied (correct values shown in /sys/module/hid_apple/parameters)

I have the same problem here, but with a Matias Quiet Pro for PC keyboard that needs fnmode=2.

Setting the parameter manually every boot with echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode works but

  boot.extraModprobeConfig = ''
    options hid_apple fnmode=2
  '';

does not.

As a workaround I did like https://gist.github.com/dmjio/3679898135b25fa49723 and passed module options using the bootloader kernel params

boot.kernelParams = [
  "hid_apple.fnmode=2"
];

Ahh, it's probably that the driver is being loaded as part of initrd and therefore the module options are not yet available.

Could we document this 'workaround' to close this issue? Or does it require changes to modules to be a default?

I have been using this without issue for a little while now.

  boot.extraModprobeConfig = ''
      options hid_apple fnmode=2
  '';
  boot.kernelModules = [ "hid-apple"  ];

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

There isn't anything directly actionable here. Closing.

Was this page helpful?
0 / 5 - 0 ratings