11# Updating? Keep $out/etc synchronized with passthru keys
22
3- { stdenv
4- , lib
5- , fetchFromGitHub
6- , gi-docgen
7- , pkg-config
8- , gobject-introspection
9- , gettext
10- , libgudev
11- , libdrm
12- , polkit
13- , libxmlb
14- , gusb
15- , sqlite
16- , libarchive
17- , libredirect
18- , curl
19- , libjcat
20- , elfutils
21- , valgrind
22- , meson
23- , libuuid
24- , ninja
25- , gnutls
26- , protobufc
27- , python3
28- , wrapGAppsNoGuiHook
29- , ensureNewerSourcesForZipFilesHook
30- , json-glib
31- , bash-completion
32- , shared-mime-info
33- , umockdev
34- , vala
35- , makeFontsConf
36- , freefont_ttf
37- , pango
38- , tpm2-tss
39- , bubblewrap
40- , efibootmgr
41- , flashrom
42- , tpm2-tools
43- , fwupd-efi
44- , nixosTests
45- , runCommand
46- , unstableGitUpdater
47- , modemmanager
48- , libqmi
49- , libmbim
50- , libcbor
51- , xz
52- , nix-update-script
53- , enableFlashrom ? false
54- , enablePassim ? false
3+ {
4+ stdenv ,
5+ lib ,
6+ fetchFromGitHub ,
7+ gi-docgen ,
8+ pkg-config ,
9+ gobject-introspection ,
10+ gettext ,
11+ libgudev ,
12+ libdrm ,
13+ polkit ,
14+ libxmlb ,
15+ gusb ,
16+ sqlite ,
17+ libarchive ,
18+ libredirect ,
19+ curl ,
20+ libjcat ,
21+ elfutils ,
22+ valgrind ,
23+ meson ,
24+ libuuid ,
25+ ninja ,
26+ gnutls ,
27+ protobufc ,
28+ python3 ,
29+ wrapGAppsNoGuiHook ,
30+ ensureNewerSourcesForZipFilesHook ,
31+ json-glib ,
32+ bash-completion ,
33+ shared-mime-info ,
34+ umockdev ,
35+ vala ,
36+ makeFontsConf ,
37+ freefont_ttf ,
38+ pango ,
39+ tpm2-tss ,
40+ bubblewrap ,
41+ efibootmgr ,
42+ flashrom ,
43+ tpm2-tools ,
44+ fwupd-efi ,
45+ nixosTests ,
46+ runCommand ,
47+ unstableGitUpdater ,
48+ modemmanager ,
49+ libqmi ,
50+ libmbim ,
51+ libcbor ,
52+ xz ,
53+ nix-update-script ,
54+ enableFlashrom ? false ,
55+ enablePassim ? false ,
5556} :
5657
5758let
58- python = python3 . withPackages ( p : with p ; [
59- jinja2
60- pygobject3
61- setuptools
62- ] ) ;
59+ python = python3 . withPackages (
60+ p : with p ; [
61+ jinja2
62+ pygobject3
63+ setuptools
64+ ]
65+ ) ;
6366
6467 isx86 = stdenv . hostPlatform . isx86 ;
6568
7881 haveFlashrom = isx86 && enableFlashrom ;
7982
8083 runPythonCommand =
81- name :
82- buildCommandPython :
84+ name : buildCommandPython :
8385
84- runCommand
85- name
86+ runCommand name
8687 {
8788 nativeBuildInputs = [ python3 ] ;
8889 inherit buildCommandPython ;
108109 } ;
109110 } ;
110111 in
111- src // {
112+ src
113+ // {
112114 meta = src . meta // {
113115 # For update script
114116 position =
@@ -126,7 +128,14 @@ stdenv.mkDerivation (finalAttrs: {
126128 # libfwupd goes to lib
127129 # daemon, plug-ins and libfwupdplugin go to out
128130 # CLI programs go to out
129- outputs = [ "out" "lib" "dev" "devdoc" "man" "installedTests" ] ;
131+ outputs = [
132+ "out"
133+ "lib"
134+ "dev"
135+ "devdoc"
136+ "man"
137+ "installedTests"
138+ ] ;
130139
131140 src = fetchFromGitHub {
132141 owner = "fwupd" ;
@@ -173,61 +182,69 @@ stdenv.mkDerivation (finalAttrs: {
173182 vala
174183 ] ;
175184
176- buildInputs = [
177- polkit
178- libxmlb
179- gusb
180- sqlite
181- libarchive
182- libdrm
183- curl
184- elfutils
185- libgudev
186- libjcat
187- libuuid
188- json-glib
189- umockdev
190- bash-completion
191- pango
192- tpm2-tss
193- fwupd-efi
194- protobufc
195- modemmanager
196- libmbim
197- libcbor
198- libqmi
199- xz # for liblzma
200- ] ++ lib . optionals haveFlashrom [
201- flashrom
202- ] ;
185+ buildInputs =
186+ [
187+ polkit
188+ libxmlb
189+ gusb
190+ sqlite
191+ libarchive
192+ libdrm
193+ curl
194+ elfutils
195+ libgudev
196+ libjcat
197+ libuuid
198+ json-glib
199+ umockdev
200+ bash-completion
201+ pango
202+ tpm2-tss
203+ fwupd-efi
204+ protobufc
205+ modemmanager
206+ libmbim
207+ libcbor
208+ libqmi
209+ xz # for liblzma
210+ ]
211+ ++ lib . optionals haveFlashrom [
212+ flashrom
213+ ] ;
203214
204- mesonFlags = [
205- "-Ddocs=enabled"
206- # We are building the official releases.
207- "-Dsupported_build=enabled"
208- "-Dlaunchd=disabled"
209- "-Dudevdir=lib/udev"
210- "-Dsystemd_root_prefix=${ placeholder "out" } "
211- "-Dinstalled_test_prefix=${ placeholder "installedTests" } "
212- "--localstatedir=/var"
213- "--sysconfdir=/etc"
214- "-Dsysconfdir_install=${ placeholder "out" } /etc"
215- "-Defi_os_dir=nixos"
216- "-Dplugin_modem_manager=enabled"
217- "-Dvendor_metadata=true"
218- # We do not want to place the daemon into lib (cyclic reference)
219- "--libexecdir=${ placeholder "out" } /libexec"
220- ] ++ lib . optionals ( ! enablePassim ) [
221- "-Dpassim=disabled"
222- ] ++ lib . optionals ( ! haveDell ) [
223- "-Dplugin_synaptics_mst=disabled"
224- ] ++ lib . optionals ( ! haveRedfish ) [
225- "-Dplugin_redfish=disabled"
226- ] ++ lib . optionals ( ! haveFlashrom ) [
227- "-Dplugin_flashrom=disabled"
228- ] ++ lib . optionals ( ! haveMSR ) [
229- "-Dplugin_msr=disabled"
230- ] ;
215+ mesonFlags =
216+ [
217+ "-Ddocs=enabled"
218+ # We are building the official releases.
219+ "-Dsupported_build=enabled"
220+ "-Dlaunchd=disabled"
221+ "-Dudevdir=lib/udev"
222+ "-Dsystemd_root_prefix=${ placeholder "out" } "
223+ "-Dinstalled_test_prefix=${ placeholder "installedTests" } "
224+ "--localstatedir=/var"
225+ "--sysconfdir=/etc"
226+ "-Dsysconfdir_install=${ placeholder "out" } /etc"
227+ "-Defi_os_dir=nixos"
228+ "-Dplugin_modem_manager=enabled"
229+ "-Dvendor_metadata=true"
230+ # We do not want to place the daemon into lib (cyclic reference)
231+ "--libexecdir=${ placeholder "out" } /libexec"
232+ ]
233+ ++ lib . optionals ( ! enablePassim ) [
234+ "-Dpassim=disabled"
235+ ]
236+ ++ lib . optionals ( ! haveDell ) [
237+ "-Dplugin_synaptics_mst=disabled"
238+ ]
239+ ++ lib . optionals ( ! haveRedfish ) [
240+ "-Dplugin_redfish=disabled"
241+ ]
242+ ++ lib . optionals ( ! haveFlashrom ) [
243+ "-Dplugin_flashrom=disabled"
244+ ]
245+ ++ lib . optionals ( ! haveMSR ) [
246+ "-Dplugin_msr=disabled"
247+ ] ;
231248
232249 # TODO: wrapGAppsHook3 wraps efi capsule even though it is not ELF
233250 dontWrapGApps = true ;
0 commit comments