From 1716c12b5410c26f7371a00be8c3f19ab6b6c907 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 1 Dec 2014 16:24:45 -0800 Subject: [PATCH] iwlwifi: Split into separate package with more up to date firmware --- nixos/modules/hardware/all-firmware.nix | 8 +- .../firmware-linux-nonfree/default.nix | 3 +- .../linux/firmware/iwlwifi/default.nix | 82 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 pkgs/os-specific/linux/firmware/iwlwifi/default.nix diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index 3820a95b12e2..a3821e9738a6 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -12,7 +12,8 @@ with lib; default = false; type = types.bool; description = '' - Turn on this option if you want to enable all the firmware shipped with Debian/Ubuntu. + Turn on this option if you want to enable all the firmware shipped with Debian/Ubuntu + and iwlwifi. ''; }; @@ -22,7 +23,10 @@ with lib; ###### implementation config = mkIf config.hardware.enableAllFirmware { - hardware.firmware = [ "${pkgs.firmwareLinuxNonfree}/lib/firmware" ]; + hardware.firmware = [ + "${pkgs.firmwareLinuxNonfree}/lib/firmware" + "${pkgs.iwlwifi}/lib/firmware" + ]; }; } diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix index 04823ffeda0c..2868be73d390 100644 --- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix +++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix @@ -17,7 +17,8 @@ let { name = "intelwimax"; sha256 = "1avls6sx0pbsffrcs267r2r2rqlx2xrv8j9znc7ix1bi8g4fx91v"; } { name = "ipw2x00"; sha256 = "19zqc30hsz7snw020izm81qbap3xsygggnmbspxndw7jihz0amjs"; } { name = "ivtv"; sha256 = "1f2004lpw5nr9rxj3cl4ba0jdm51wkvsrbiy4drakawpjwh5y4qw"; } - { name = "iwlwifi"; sha256 = "1538r751mx8nhg3xibnnrhnflvf3kl5y9rnm7rpl4wyrfgx61amd"; } + # Disabled as it is packaged separately + #{ name = "iwlwifi"; sha256 = "1538r751mx8nhg3xibnnrhnflvf3kl5y9rnm7rpl4wyrfgx61amd"; } { name = "libertas"; sha256 = "0svkqlsiqgmh970r38nh0c1pjx41zdfql2k2k5djw99fscjklacd"; } { name = "linux"; sha256 = "0j62v6vbh2287j3x5c9i0xspmhyh5k1z8dyajgix7k37xi4jvpy2"; } { name = "linux-nonfree"; sha256 = "1f5x72rzicivwm0sn9l6wjkx7z9a0b8n6c9m60xrqg36ly7mizzp"; } diff --git a/pkgs/os-specific/linux/firmware/iwlwifi/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi/default.nix new file mode 100644 index 000000000000..f6df3bb50f42 --- /dev/null +++ b/pkgs/os-specific/linux/firmware/iwlwifi/default.nix @@ -0,0 +1,82 @@ +{ stdenv, fetchurl }: + +let + packages = [ + # Kernel 2.6.29+ + { name = "5150-ucode-8.24.2.2"; sha256 = "1y8cah9xa8a9c7alh220cvmncjmwnacdz0kwsvg9lqr4cvzyclyj"; } + + # Kernel 2.6.30+ + { name = "6000-ucode-9.221.4.1"; sha256 = "0sw3v9807agx4mxdrfgsw7f195gs1f4zscnzcgpc8gb664r6413z"; } + + # Kernel 2.6.37+ + { name = "6050-ucode-41.28.5.1"; sha256 = "1i10rfn3kc07s2iqz79wvsrblhm360yz6v231dcz8sabvcyrlzar"; } + { name = "100-ucode-39.31.5.1"; sha256 = "1jvzdaiklnw613c4drkjkcdlnnk6c9kk7f0jqdxfkgppydwssnc2"; } + + # Kernel 2.6.38+ + { name = "5000-ucode-8.83.5.1-1"; sha256 = "0pkzr4gflp3j0jm4rw66jypk3xn4bvpgdsnxjqwanyd64aj6naxg"; } + + # Kernel 3.2+ + { name = "6000g2b-ucode-18.168.6.1"; sha256 = "1shby6s9h4kfwmvg89505p61yq88ml1qccvw8h2m4l63a9mwg0qn"; } + { name = "6000g2a-ucode-18.168.6.1"; sha256 = "1sdv4lkpfd87c95zbk8wgn0b4l4nbwkb0b4iwvrzpnmdarbn3wm7"; } + { name = "1000-ucode-39.31.5.1"; sha256 = "0w69hfpwx79cph0517a6mkhsk51li2l0yhfr1jddmj3i4ny1y3zd"; } + { name = "135-ucode-18.168.6.1"; sha256 = "1dvyzwkyzsmvlp13z84g2lzkr0w0p8mj7c98fwh3pwv0cmglf04c"; } + { name = "105-ucode-18.168.6.1"; sha256 = "11z67ippn4hlmsnyv1lxknysrl3m5v908i9wf1nkm7kxw76biz04"; } + { name = "2000-ucode-18.168.6.1"; sha256 = "0ax98hlmz11hqi0k81j5cizp2hwaah7j6s3hw7jdfsmwpzy9lwrm"; } + { name = "2030-ucode-18.168.6.1"; sha256 = "0b69jpb46fk63ybyyb8lbh99j1d29ayp8fl98l18iqy3q7mx4ry8"; } + + # Kernel 3.10+ + { name = "7260-ucode-22.1.7.0"; sha256 = "0m31p98zwr70k3b9akha0d8n7x9ym43yg992jk8zd94159g37k0y"; } + { name = "3160-ucode-22.1.7.0"; sha256 = "0qfm854xv6dc6kqj0vym1avrirrshnxp9yqnlx356zvfnqyx4l33"; } + + # Kernel 3.13+ + { name = "7260-ucode-22.24.8.0"; sha256 = "1zvw5dj3kv7rdnypcmp6na8mlfw735nzahy8qz35zrmda8b6gvqi"; } + { name = "3160-ucode-22.24.8.0"; sha256 = "1jv3bhds3a3y2r719fqpc5cwb674hm3lwq9df11i6473f0xjs224"; } + { name = "7265-ucode-22.24.8.0"; sha256 = "1pvmc58gyr62akzdj8gx02y3i3d67zwawm8zdvpg2q615721wjp9"; } + + # Kernel 3.14.9+ + { name = "7260-ucode-25.228.9.0"; sha256 = "0ppx9lpkc2l9aggdadw4y2cpdz5zqyckshzhlb1qj60jbajiny36"; } + { name = "3160-ucode-25.228.9.0"; sha256 = "125kh5p21bx808l2al8v9a1g63396d1a1chf4amqa9zrp2aajmk8"; } + { name = "7265-ucode-25.228.9.0"; sha256 = "1dv9bai1s6vdigsahbrxjwlndnp2dsgkqz8j7021d34s99kbi6z8"; } + + # Kernel 3.17+ + { name = "7260-ucode-23.10.10.0"; sha256 = "0n8blgwj3765zyripgbawbi3h97qyficdv72mmzf8hznk30p6kxg"; } + { name = "3160-ucode-23.10.10.0"; sha256 = "0332j710495980avzvhjixnr6f4f8v0srpnqn05x1q0c9sw6n7pp"; } + # Bad archive, assumed a problem with the served blob + #{ name = "7265-ucode-23.10.10.0"; sha256 = "1v2q9b3dah1p4mnmvv1blvi9awjcbiafmjyll5hi1hr6p28xwhva"; } + ]; + + fetchPackage = + { name, sha256 }: fetchurl { + name = "iwlwifi-${name}.tgz"; + url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=iwlwifi-${name}.tgz"; + inherit sha256; + }; + + srcs = map fetchPackage packages; + +in stdenv.mkDerivation { + name = "iwlwifi"; + inherit srcs; + + unpackPhase = '' + mkdir -p ./firmware + ''; + + buildPhase = '' + for src in $srcs; do + tar zxf $src + done + ''; + + installPhase = '' + mkdir -p $out/lib/firmware + cp -r iwlwifi-*/*.ucode "$out/lib/firmware/" + ''; + + meta = { + description = "Binary firmware collection from intel"; + homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi; + license = stdenv.lib.licenses.unfreeRedistributableFirmware; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4bf515510c71..9b2f09a924f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8125,6 +8125,8 @@ let iw = callPackage ../os-specific/linux/iw { }; + iwlwifi = callPackage ../os-specific/linux/firmware/iwlwifi { }; + jujuutils = callPackage ../os-specific/linux/jujuutils { }; kbd = callPackage ../os-specific/linux/kbd { };