diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2015-11-20 14:32:58 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2015-11-20 14:32:58 +0100 |
commit | 333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb (patch) | |
tree | 0f4757ddd2bb3d73b438eea85828d8e01c049583 /lib | |
parent | bdbbfa0d4247e203ffe3171621b614374da05f70 (diff) | |
parent | b809f886c0bdbd4665fc65a4c308d38a30c368d8 (diff) |
Merge staging into closure-size
The most complex problems were from dealing with switches reverted in the meantime (gcc5, gmp6, ncurses6). It's likely that darwin is (still) broken nontrivially.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/attrsets.nix | 2 | ||||
-rw-r--r-- | lib/maintainers.nix | 22 | ||||
-rw-r--r-- | lib/modules.nix | 65 |
3 files changed, 87 insertions, 2 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 5aad76e75e4d4..22ecc808679d0 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -116,7 +116,7 @@ rec { Type: collect :: - (AttrSet -> Bool) -> AttrSet -> AttrSet + (AttrSet -> Bool) -> AttrSet -> [x] Example: collect isList { a = { b = ["b"]; }; c = [1]; } diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 071a4d45ba23d..14a7de594aa24 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -76,11 +76,13 @@ dbohdan = "Danyil Bohdan <danyil.bohdan@gmail.com>"; DerGuteMoritz = "Moritz Heidkamp <moritz@twoticketsplease.de>"; deepfire = "Kosyrev Serge <_deepfire@feelingofgreen.ru>"; + demin-dmitriy = "Dmitriy Demin <demindf@gmail.com>"; desiderius = "Didier J. Devroye <didier@devroye.name>"; devhell = "devhell <\"^\"@regexmail.net>"; dezgeg = "Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>"; dfoxfranke = "Daniel Fox Franke <dfoxfranke@gmail.com>"; dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>"; + dochang = "Desmond O. Chang <dochang@gmail.com>"; doublec = "Chris Double <chris.double@double.co.nz>"; ebzzry = "Rommel Martinez <ebzzry@gmail.com>"; ederoyd46 = "Matthew Brown <matt@ederoyd.co.uk>"; @@ -88,8 +90,10 @@ edwtjo = "Edward Tjörnhammar <ed@cflags.cc>"; eelco = "Eelco Dolstra <eelco.dolstra@logicblox.com>"; eikek = "Eike Kettner <eike.kettner@posteo.de>"; + elasticdog = "Aaron Bull Schaefer <aaron@elasticdog.com>"; ellis = "Ellis Whitehead <nixos@ellisw.net>"; emery = "Emery Hemingway <emery@vfemail.net>"; + enolan = "Echo Nolan <echo@echonolan.net>"; epitrochoid = "Mabry Cervin <mpcervin@uncg.edu>"; ericbmerritt = "Eric Merritt <eric@afiniate.com>"; erikryb = "Erik Rybakken <erik.rybakken@math.ntnu.no>"; @@ -100,6 +104,7 @@ fluffynukeit = "Daniel Austin <dan@fluffynukeit.com>"; forkk = "Andrew Okin <forkk@forkk.net>"; fpletz = "Franz Pletz <fpletz@fnordicwalking.de>"; + fps = "Florian Paul Schmidt <mista.tapas@gmx.net>"; fridh = "Frederik Rietdijk <fridh@fridh.nl>"; fro_ozen = "fro_ozen <fro_ozen@gmx.de>"; ftrvxmtrx = "Siarhei Zirukin <ftrvxmtrx@gmail.com>"; @@ -129,6 +134,7 @@ iyzsong = "Song Wenwu <iyzsong@gmail.com>"; j-keck = "Jürgen Keck <jhyphenkeck@gmail.com>"; jagajaga = "Arseniy Seroka <ars.seroka@gmail.com>"; + javaguirre = "Javier Aguirre <contacto@javaguirre.net>"; jb55 = "William Casarin <bill@casarin.me>"; jcumming = "Jack Cummings <jack@mudshark.org>"; jefdaj = "Jeffrey David Johnson <jefdaj@gmail.com>"; @@ -149,7 +155,7 @@ kkallio = "Karn Kallio <tierpluspluslists@gmail.com>"; koral = "Koral <koral@mailoo.org>"; kovirobi = "Kovacsics Robert <kovirobi@gmail.com>"; - kragniz = "Louis Taylor <kragniz@gmail.com>"; + kragniz = "Louis Taylor <louis@kragniz.eu>"; ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>"; lassulus = "Lassulus <lassulus@gmail.com>"; layus = "Guillaume Maudoux <layus.on@gmail.com>"; @@ -165,6 +171,8 @@ lowfatcomputing = "Andreas Wagner <andreas.wagner@lowfatcomputing.org>"; lsix = "Lancelot SIX <lsix@lancelotsix.com>"; ludo = "Ludovic Courtès <ludo@gnu.org>"; + lukego = "Luke Gorrie <luke@snabb.co>"; + lw = "Sergey Sofeychuk <lw@fmap.me>"; madjar = "Georges Dubus <georges.dubus@compiletoi.net>"; magnetophon = "Bart Brouns <bart@magnetophon.nl>"; mahe = "Matthias Herrmann <matthias.mh.herrmann@gmail.com>"; @@ -177,6 +185,7 @@ mathnerd314 = "Mathnerd314 <mathnerd314.gph+hs@gmail.com>"; matthiasbeyer = "Matthias Beyer <mail@beyermatthias.de>"; mbakke = "Marius Bakke <ymse@tuta.io>"; + mbe = "Brandon Edens <brandonedens@gmail.com>"; meditans = "Carlo Nucera <meditans@gmail.com>"; meisternu = "Matt Miemiec <meister@krutt.org>"; michelk = "Michel Kuhlmann <michel@kuhlmanns.info>"; @@ -184,14 +193,17 @@ mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>"; mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>"; modulistic = "Pablo Costa <modulistic@gmail.com>"; + mog = "Matthew O'Gorman <mog-lists@rldn.net>"; mornfall = "Petr Ročkai <me@mornfall.net>"; MP2E = "Cray Elliott <MP2E@archlinux.us>"; msackman = "Matthew Sackman <matthew@wellquite.org>"; + msteen = "Matthijs Steen <emailmatthijs@gmail.com>"; mtreskin = "Max Treskin <zerthurd@gmail.com>"; mudri = "James Wood <lamudri@gmail.com>"; muflax = "Stefan Dorn <mail@muflax.com>"; nathan-gs = "Nathan Bijnens <nathan@nathan.gs>"; nckx = "Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>"; + nico202 = "Nicolò Balzarotti <anothersms@gmail.com>"; notthemessiah = "Brian Cohen <brian.cohen.88@gmail.com>"; np = "Nicolas Pouillard <np.nix@nicolaspouillard.fr>"; nslqqq = "Nikita Mikhailov <nslqqq@gmail.com>"; @@ -212,6 +224,7 @@ phreedom = "Evgeny Egorochkin <phreedom@yandex.ru>"; pierron = "Nicolas B. Pierron <nixos@nbp.name>"; piotr = "Piotr Pietraszkiewicz <ppietrasa@gmail.com>"; + pjbarnoy = "Perry Barnoy <pjbarnoy@gmail.com>"; pjones = "Peter Jones <pjones@devalot.com>"; pkmx = "Chih-Mao Chen <pkmx.tw@gmail.com>"; plcplc = "Philip Lykke Carlsen <plcplc@gmail.com>"; @@ -230,9 +243,11 @@ renzo = "Renzo Carbonara <renzocarbonara@gmail.com>"; rick68 = "Wei-Ming Yang <rick68@gmail.com>"; rickynils = "Rickard Nilsson <rickynils@gmail.com>"; + rnhmjoj = "Michele Guerini Rocco <micheleguerinirocco@me.com>"; rob = "Rob Vermaas <rob.vermaas@gmail.com>"; robberer = "Longrin Wischnewski <robberer@freakmail.de>"; robbinch = "Robbin C. <robbinch33@gmail.com>"; + robgssp = "Rob Glossop <robgssp@gmail.com>"; roconnor = "Russell O'Connor <roconnor@theorem.ca>"; roelof = "Roelof Wobben <rwobben@hotmail.com>"; romildo = "José Romildo Malaquias <malaquias@gmail.com>"; @@ -251,12 +266,15 @@ simonvandel = "Simon Vandel Sillesen <simon.vandel@gmail.com>"; sjagoe = "Simon Jagoe <simon@simonjagoe.com>"; sjmackenzie = "Stewart Mackenzie <setori88@gmail.com>"; + sjourdois = "Stéphane ‘kwisatz’ Jourdois <sjourdois@gmail.com>"; skeidel = "Sven Keidel <svenkeidel@gmail.com>"; smironov = "Sergey Mironov <ierton@gmail.com>"; spacefrogg = "Michael Raitza <spacefrogg-nixos@meterriblecrew.net>"; + spencerjanssen = "Spencer Janssen <spencerjanssen@gmail.com>"; sprock = "Roger Mason <rmason@mun.ca>"; spwhitt = "Spencer Whitt <sw@swhitt.me>"; stephenmw = "Stephen Weinberg <stephen@q5comm.com>"; + steveej = "Stefan Junker <mail@stefanjunker.de>"; szczyp = "Szczyp <qb@szczyp.com>"; sztupi = "Attila Sztupak <attila.sztupak@gmail.com>"; tailhook = "Paul Colomiets <paul@colomiets.name>"; @@ -267,6 +285,7 @@ theuni = "Christian Theune <ct@flyingcircus.io>"; thoughtpolice = "Austin Seipp <aseipp@pobox.com>"; titanous = "Jonathan Rudenberg <jonathan@titanous.com>"; + tokudan = "Daniel Frank <git@danielfrank.net>"; tomberek = "Thomas Bereknyei <tomberek@gmail.com>"; travisbhartwell = "Travis B. Hartwell <nafai@travishartwell.net>"; trino = "Hubert Mühlhans <muehlhans.hubert@ekodia.de>"; @@ -284,6 +303,7 @@ vlstill = "Vladimír Štill <xstill@fi.muni.cz>"; vmandela = "Venkateswara Rao Mandela <venkat.mandela@gmail.com>"; vozz = "Oliver Hunt <oliver.huntuk@gmail.com>"; + wedens = "wedens <kirill.wedens@gmail.com>"; winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>"; wizeman = "Ricardo M. Correia <rcorreia@wizy.org>"; wjlroe = "William Roe <willroe@gmail.com>"; diff --git a/lib/modules.nix b/lib/modules.nix index 3e4d0547ecc5b..12ec7004d1ee4 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -469,6 +469,7 @@ rec { mkBefore = mkOrder 500; mkAfter = mkOrder 1500; + # Convenient property used to transfer all definitions and their # properties from one option to another. This property is useful for # renaming options, and also for including properties from another module @@ -498,4 +499,68 @@ rec { /* Compatibility. */ fixMergeModules = modules: args: evalModules { inherit modules args; check = false; }; + + /* Return a module that causes a warning to be shown if the + specified option is defined. For example, + + mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] + + causes a warning if the user defines boot.loader.grub.bootDevice. + */ + mkRemovedOptionModule = optionName: + { options, ... }: + { options = setAttrByPath optionName (mkOption { + visible = false; + }); + config.warnings = + let opt = getAttrFromPath optionName options; in + optional opt.isDefined + "The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it."; + }; + + /* Return a module that causes a warning to be shown if the + specified "from" option is defined; the defined value is however + forwarded to the "to" option. This can be used to rename options + while providing backward compatibility. For example, + + mkRenamedOptionModule [ "boot" "copyKernels" ] [ "boot" "loader" "grub" "copyKernels" ] + + forwards any definitions of boot.copyKernels to + boot.loader.grub.copyKernels while printing a warning. + */ + mkRenamedOptionModule = from: to: doRename { + inherit from to; + visible = false; + warn = true; + use = builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'."; + }; + + /* Like ‘mkRenamedOptionModule’, but doesn't show a warning. */ + mkAliasOptionModule = from: to: doRename { + inherit from to; + visible = true; + warn = false; + use = id; + }; + + doRename = { from, to, visible, warn, use }: + let + toOf = attrByPath to + (abort "Renaming error: option `${showOption to}' does not exists."); + in + { config, options, ... }: + { options = setAttrByPath from (mkOption { + description = "Alias of <option>${showOption to}</option>."; + apply = x: use (toOf config); + }); + config = { + /* + warnings = + let opt = getAttrFromPath from options; in + optional (warn && opt.isDefined) + "The option `${showOption from}' defined in ${showFiles opt.files} has been renamed to `${showOption to}'."; + */ + } // setAttrByPath to (mkAliasDefinitions (getAttrFromPath from options)); + }; + } |