intel2200BGFirmware: less fixed-output derivation

Move some logic out of the fixed-output fetchzip and to a
'regular' derivation

authored by Arnout Engelen and committed by sterni d51f8351 8b78f2e2

+15 -8
+15 -8
pkgs/os-specific/linux/firmware/intel2200BGFirmware/default.nix
··· 1 - { lib, fetchzip }: 1 + { stdenv 2 + , lib 3 + , fetchurl }: 2 4 3 - let version = "3.1"; in 5 + stdenv.mkDerivation rec { 6 + pname = "intel2200BGFirmware"; 7 + version = "3.1"; 8 + 9 + src = fetchurl { 10 + url = "https://src.fedoraproject.org/repo/pkgs/ipw2200-firmware/ipw2200-fw-${version}.tgz/eaba788643c7cc7483dd67ace70f6e99/ipw2200-fw-${version}.tgz"; 11 + hash = "sha256-xoGMEcGMwDDVX/g/ZLK62P7vSF53QvhPlKYdgRpiWL0="; 12 + }; 4 13 5 - fetchzip { 6 - name = "intel2200BGFirmware-${version}"; 7 - url = "https://src.fedoraproject.org/repo/pkgs/ipw2200-firmware/ipw2200-fw-${version}.tgz/eaba788643c7cc7483dd67ace70f6e99/ipw2200-fw-${version}.tgz"; 8 - sha256 = "0zjyjndyc401pn5x5lgypxdal21n82ymi3vbb2ja1b89yszj432b"; 14 + installPhase = '' 15 + runHook preInstall 9 16 10 - postFetch = '' 11 - tar -xzvf $downloadedFile --strip-components=1 12 17 install -D -m644 ipw2200-bss.fw $out/lib/firmware/ipw2200-bss.fw 13 18 install -D -m644 ipw2200-ibss.fw $out/lib/firmware/ipw2200-ibss.fw 14 19 install -D -m644 ipw2200-sniffer.fw $out/lib/firmware/ipw2200-sniffer.fw 15 20 install -D -m644 LICENSE.ipw2200-fw $out/share/doc/intel2200BGFirmware/LICENSE 21 + 22 + runHook postInstall 16 23 ''; 17 24 18 25 meta = with lib; {