[Nix-dev] [NixOS] How to incorporate my Bash script in configuration.nix?

Peter Hoeg peter at hoeg.com
Wed May 10 03:18:15 CEST 2017


Hi,

>   > The proper way to do this is to set up modaliases
>
>   Could you please elaborate further?

the alias in the line below depends on the exact PID and VID of your device so you may need to adjust it:

  boot.kernelModules = [ "rt2800usb" ];
  boot.extraModprobeConfig = ''
    alias usb:v0B05p17E8d*dc*dsc*dp*ic*isc*ip*in* rt2800usb
    install rt2800usb ${pkgs.kmod}/sbin/modprobe --ignore-install rt2800usb && echo 0x0B05 0x17E8 >/sys/bus/usb/drivers/rt2800usb/new_id
  '';

This is from: https://github.com/jethrokuan/nix-config/blob/master/desktop/configuration.nix

--
Regards,
Peter


More information about the nix-dev mailing list