diff options
author | aszlig <aszlig@redmoonstudios.org> | 2016-04-09 22:23:04 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2016-04-09 22:23:04 +0200 |
commit | 8c944f594e83f31b96a5a05ea2a7706a0305d4ec (patch) | |
tree | 2fe520a70c9578d79a4563f966f105e9eee1eb65 /modules/hardware/rtl8192cu/default.nix | |
parent | 0182e0ca12760da2aecd65de98c85a76ecdcedc6 (diff) |
hardware/rtl8192cu: Move into its own directory
This is to not clutter up the hardware/ namespace with patches (we're going to add one). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/hardware/rtl8192cu/default.nix')
-rw-r--r-- | modules/hardware/rtl8192cu/default.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/hardware/rtl8192cu/default.nix b/modules/hardware/rtl8192cu/default.nix new file mode 100644 index 00000000..8e4619a4 --- /dev/null +++ b/modules/hardware/rtl8192cu/default.nix @@ -0,0 +1,48 @@ +{ config, pkgs, lib, ... }: + +let + inherit (config.boot.kernelPackages) kernel; + + modBaseDir = "kernel/drivers/net/wireless"; + + rtl8192cu = pkgs.stdenv.mkDerivation { + name = "rtl8192cu-${kernel.version}"; + + src = pkgs.fetchFromGitHub { + owner = "pvaret"; + repo = "rtl8192cu-fixes"; + rev = "f3edeeef68808f0f6fc06b5e36b559e1d06232ab"; + sha256 = "0v0rrxfmvi9flrg3xns826a6n1mlgd3vs5z2x59aqvwfj5b4rv7b"; + }; + + postPatch = '' + substituteInPlace Makefile --replace /sbin/depmod : + ''; + + makeFlags = [ + "BUILD_KERNEL=${kernel.modDirVersion}" + "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "MODDESTDIR=$(out)/lib/modules/${kernel.modDirVersion}/${modBaseDir}/" + ]; + + preInstall = '' + mkdir -p "$out/lib/modules/${kernel.modDirVersion}/${modBaseDir}" + ''; + + enableParallelBuilding = true; + }; + +in { + options.vuizvui.hardware.rtl8192cu = { + enable = lib.mkEnableOption "support for RTL8192CU wireless chipset"; + }; + + config = lib.mkIf config.vuizvui.hardware.rtl8192cu.enable { + boot.extraModulePackages = [ rtl8192cu ]; + # Note that the module is called "8192cu" so we don't blacklist the module + # we actually want to use. The ones we blacklist here are the modules from + # the mainline kernel, which unfortunately do not seem to work very well. + boot.blacklistedKernelModules = [ "rtl8192cu" "rtl8192c_common" "rtlwifi" ]; + networking.enableRTL8192cFirmware = true; + }; +} |