@ -1,22 +1,47 @@
{ stdenv , fetchFromGitHub }:
{ stdenv , fetchgit , runCommand , git , cacert , gnupg }:
stdenv . mkDerivation rec {
name = " f i r m w a r e - l i n u x - n o n f r e e - ${ version } " ;
version = " 2 0 1 7 - 0 7 - 0 5 " ;
version = " 2 0 1 7 - 1 0 - 0 9 - ${ src . iwlRev } " ;
# This repo is built by merging the latest versions of
# The src runCommand automates the process of building a merged repository of both
#
# http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/
# and
# http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/
# for any given date. This gives us up to date iwlwifi firmware as well as
#
# This gives us up to date iwlwifi firmware as well as
# the usual set of firmware. firmware/linux-firmware usually lags kernel releases
# so iwlwifi cards will fail to load on newly released kernels.
src = fetchFromGitHub {
owner = " f p l e t z " ;
repo = " l i n u x - f i r m w a r e " ;
rev = version ;
sha256 = " 0 v l k 0 4 3 y 7 c 3 2 g 4 d 9 h z 9 3 j 6 4 x 3 7 2 q q r w s q 6 5 m h 8 s 5 s 5 x r v a m j a 2 i f " ;
} ;
#
# To update, go to the above repositories and look for latest tags / commits, then
# update version to the more recent commit date
src = runCommand " f i r m w a r e - l i n u x - n o n f r e e - s r c - m e r g e d - ${ version } " {
# When updating this, you need to let it run with a wrong hash, in order to find out the desired hash
baseRev = " b f 0 4 2 9 1 3 0 9 d 3 1 6 9 c 0 a d 3 b 8 d b 5 2 5 6 4 2 3 5 b b d 0 8 e 3 0 " ;
iwlRev = " i w l w i f i - f w - 2 0 1 7 - 1 1 - 0 3 " ;
# randomly mutate the hash to break out of fixed hash, when updating
outputHash = " 1 1 i z v 1 v p q 9 i x l q d s s 1 9 l z s 5 q 2 8 9 d 7 j x r 5 k g f 6 i y m k 4 a l x z n f f d 8 z " ;
outputHashAlgo = " s h a 2 5 6 " ;
outputHashMode = " r e c u r s i v e " ;
buildInputs = [ git gnupg ] ;
NIX_SSL_CERT_FILE = " ${ cacert } / e t c / s s l / c e r t s / c a - b u n d l e . c r t " ;
} ''
git init src && (
cd src
git config user . email " b u i l d - d a e m o n @ n i x o s . o r g "
git config user . name " N i x o s B u i l d D a e m o n $ n a m e "
git remote add base git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
git remote add iwl git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git
git fetch base $ baseRev
git checkout - b work FETCH_HEAD
git fetch iwl $ iwlRev
git merge FETCH_HEAD )
rm - rf src/.git
cp - a src $ out
'' ;
preInstall = ''
mkdir - p $ out