summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/customisation.nix23
-rw-r--r--lib/maintainers.nix4
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 91a25055df2..ca3dd4980da 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -158,4 +158,27 @@ rec {
       drv' = (lib.head outputsList).value;
     in lib.deepSeq drv' drv';
 
+
+  /* Tests whether a derivation can be used by the current platform
+     Returns the derivation if true, otherwise null. */
+  shouldUsePkgSystem = system: pkg_: let pkg = (builtins.tryEval pkg_).value;
+    in if lib.any (x: x == system) (pkg.meta.platforms or [])
+      then pkg
+      else null;
+
+  /* Returns a configure flag string in an autotools format
+     trueStr: Prepended when cond is true
+     falseStr: Prepended when cond is false
+     cond: The condition for the prepended string type and value
+     name: The flag name
+     val: The value of the flag only set when cond is true */
+  mkFlag = trueStr: falseStr: cond: name: val:
+    if cond == null then null else
+      "--${if cond != false then trueStr else falseStr}${name}"
+      + "${if val != null && cond != false then "=${val}" else ""}";
+
+  /* Flag setting helpers for autotools like packages */
+  mkEnable = mkFlag "enable-" "disable-";
+  mkWith = mkFlag "with-" "without-";
+  mkOther = mkFlag "" "" true;
 }
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index 3057da847ee..ec3d6b84dd6 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -8,6 +8,7 @@
   abaldeau = "Andreas Baldeau <andreas@baldeau.net>";
   abbradar = "Nikolay Amiantov <ab@fmap.me>";
   aforemny = "Alexander Foremny <alexanderforemny@googlemail.com>";
+  aflatter = "Alexander Flatter <flatter@fastmail.fm>";
   aherrmann = "Andreas Herrmann <andreash87@gmx.ch>";
   ak = "Alexander Kjeldaas <ak@formalprivacy.com>";
   akc = "Anders Claesson <akc@akc.is>";
@@ -136,6 +137,7 @@
   meditans = "Carlo Nucera <meditans@gmail.com>";
   meisternu = "Matt Miemiec <meister@krutt.org>";
   michelk = "Michel Kuhlmann <michel@kuhlmanns.info>";
+  mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>";
   mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>";
   modulistic = "Pablo Costa <modulistic@gmail.com>";
   mornfall = "Petr Ročkai <me@mornfall.net>";
@@ -153,6 +155,7 @@
   offline = "Jaka Hudoklin <jakahudoklin@gmail.com>";
   olcai = "Erik Timan <dev@timan.info>";
   orbitz = "Malcolm Matalka <mmatalka@gmail.com>";
+  osener = "Ozan Sener <ozan@ozansener.com>";
   page = "Carles Pagès <page@cubata.homelinux.net>";
   paholg = "Paho Lurie-Gregg <paho@paholg.com>";
   pakhfn = "Fedor Pakhomov <pakhfn@gmail.com>";
@@ -201,6 +204,7 @@
   smironov = "Sergey Mironov <ierton@gmail.com>";
   sprock = "Roger Mason <rmason@mun.ca>";
   spwhitt = "Spencer Whitt <sw@swhitt.me>";
+  stephenmw = "Stephen Weinberg <stephen@q5comm.com>";
   sztupi = "Attila Sztupak <attila.sztupak@gmail.com>";
   tailhook = "Paul Colomiets <paul@colomiets.name>";
   taktoa = "Remy Goldschmidt <taktoa@gmail.com>";