diff --git a/machines/moby/default.nix b/machines/moby/default.nix index 81beeb56..375d28a8 100644 --- a/machines/moby/default.nix +++ b/machines/moby/default.nix @@ -170,6 +170,7 @@ # anx7688-fw.bin (USB-C -> HDMI bridge) # ov5640_af.bin (camera module) # hardware.firmware = [ config.mobile.device.firmware ]; + hardware.firmware = [ pkgs.rtl8723cs-firmware ]; system.stateVersion = "21.11"; diff --git a/pkgs/overlay.nix b/pkgs/overlay.nix index b9c7a131..372499a8 100644 --- a/pkgs/overlay.nix +++ b/pkgs/overlay.nix @@ -12,6 +12,7 @@ # not sure why i can't just do pkgs = next here pkgs = prev // { inherit ubootRaspberryPi4_64bit; }; }; + rtl8723cs-firmware = prev.callPackage ./rtl8723cs-firmware { }; #### customized packages # nixos-unstable pleroma is too far out-of-date for our db diff --git a/pkgs/rtl8723cs-firmware/default.nix b/pkgs/rtl8723cs-firmware/default.nix new file mode 100644 index 00000000..4431fa25 --- /dev/null +++ b/pkgs/rtl8723cs-firmware/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub }: +with lib; +stdenv.mkDerivation { + pname = "rtl8723cs-firmware"; + version = "2020-07-05"; + + src = fetchFromGitHub { + owner = "anarsoul"; + repo = "rtl8723bt-firmware"; + rev = "8840b1052b4ee426f348cb35e4994c5cafc5fbbd"; + sha256 = "sha256-z6OZNDvGbU1g+U9aL/Pq6fB3l7Fxwq6EHSeHgrkqt78="; + }; + + dontBuild = true; + + installPhase = '' + mkdir -p "$out/lib/firmware" + cp -R rtl_bt "$out/lib/firmware" + ''; + + meta = with lib; { + description = "Firmware for rtl8723bs and rtl8723cs"; + # there are many sources for this, none of them authoritative. + # the original binaries likely come from some Realtek SDK, hardcoded into a C array + # if consistent with other drivers, but Realtek does not list this model in their + # downloads page. + # other sources: + # - + # - + homepage = "https://github.com/anarsoul/rtl8723bt-firmware"; + license = licenses.unfreeRedistributableFirmware; + maintainers = with maintainers; [ colinsane ]; + platforms = with platforms; linux; + }; +} +