diff options
author | Greg Pfeil <greg@technomadic.org> | 2018-01-12 15:08:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-12 15:08:44 -0700 |
commit | 38deb5354221881f8fa6437d7b1c522835fb2aba (patch) | |
tree | 54827d401c7f65c7b635e018c7428b988515f7de /lib | |
parent | 79db7c0616c38ac15ea0f6734034053e92b3cca2 (diff) | |
parent | 5f232de6cda58185c4a0a4f3d4a73b9e9f2856be (diff) | |
download | nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar.gz nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar.bz2 nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar.lz nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar.xz nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.tar.zst nixlib-38deb5354221881f8fa6437d7b1c522835fb2aba.zip |
Merge branch 'master' into add/flootty
Diffstat (limited to 'lib')
35 files changed, 556 insertions, 257 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix index d2946f6ca9cb..19218cfe8ecb 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -1,11 +1,11 @@ +{ lib }: # Operations on attribute sets. let inherit (builtins) head tail length; - inherit (import ./trivial.nix) and or; - inherit (import ./default.nix) fold; - inherit (import ./strings.nix) concatStringsSep; - inherit (import ./lists.nix) concatMap concatLists all deepSeqList; + inherit (lib.trivial) and or; + inherit (lib.strings) concatStringsSep; + inherit (lib.lists) fold concatMap concatLists all deepSeqList; in rec { diff --git a/lib/customisation.nix b/lib/customisation.nix index 98a46ca6c616..483ef6fd4866 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -1,6 +1,6 @@ +{ lib }: let - lib = import ./default.nix; inherit (builtins) attrNames isFunction; in diff --git a/lib/debug.nix b/lib/debug.nix index 925e0d405a79..646ef220ad0a 100644 --- a/lib/debug.nix +++ b/lib/debug.nix @@ -1,4 +1,6 @@ -let lib = import ./default.nix; +{ lib }: + +let inherit (builtins) trace attrNamesToStr isAttrs isFunction isList isInt isString isBool head substring attrNames; diff --git a/lib/default.nix b/lib/default.nix index 3893e349db36..03a902945a3b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -5,58 +5,126 @@ */ let - # often used, or depending on very little - trivial = import ./trivial.nix; - fixedPoints = import ./fixed-points.nix; - - # datatypes - attrsets = import ./attrsets.nix; - lists = import ./lists.nix; - strings = import ./strings.nix; - stringsWithDeps = import ./strings-with-deps.nix; - - # packaging - customisation = import ./customisation.nix; - maintainers = import ./maintainers.nix; - meta = import ./meta.nix; - sources = import ./sources.nix; - - # module system - modules = import ./modules.nix; - options = import ./options.nix; - types = import ./types.nix; - - # constants - licenses = import ./licenses.nix; - systems = import ./systems; - - # misc - debug = import ./debug.nix; - generators = import ./generators.nix; - misc = import ./deprecated.nix; - - # domain-specific - sandbox = import ./sandbox.nix; - fetchers = import ./fetchers.nix; - - # Eval-time filesystem handling - filesystem = import ./filesystem.nix; - -in - { inherit trivial fixedPoints - attrsets lists strings stringsWithDeps - customisation maintainers meta sources - modules options types - licenses systems - debug generators misc - sandbox fetchers filesystem; + callLibs = file: import file { inherit lib; }; + + lib = rec { + + # often used, or depending on very little + trivial = callLibs ./trivial.nix; + fixedPoints = callLibs ./fixed-points.nix; + + # datatypes + attrsets = callLibs ./attrsets.nix; + lists = callLibs ./lists.nix; + strings = callLibs ./strings.nix; + stringsWithDeps = callLibs ./strings-with-deps.nix; + + # packaging + customisation = callLibs ./customisation.nix; + maintainers = callLibs ./maintainers.nix; + meta = callLibs ./meta.nix; + sources = callLibs ./sources.nix; + + + # module system + modules = callLibs ./modules.nix; + options = callLibs ./options.nix; + types = callLibs ./types.nix; + + # constants + licenses = callLibs ./licenses.nix; + systems = callLibs ./systems; + + # misc + debug = callLibs ./debug.nix; + + generators = callLibs ./generators.nix; + misc = callLibs ./deprecated.nix; + # domain-specific + fetchers = callLibs ./fetchers.nix; + + # Eval-time filesystem handling + filesystem = callLibs ./filesystem.nix; # back-compat aliases platforms = systems.doubles; - } - # !!! don't include everything at top-level; perhaps only the most - # commonly used functions. - // trivial // fixedPoints - // lists // strings // stringsWithDeps // attrsets // sources - // options // types // meta // debug // misc // modules - // customisation + + inherit (builtins) add addErrorContext attrNames + concatLists deepSeq elem elemAt filter genericClosure genList + getAttr hasAttr head isAttrs isBool isFunction isInt isList + isString length lessThan listToAttrs pathExists readFile + replaceStrings seq stringLength sub substring tail; + inherit (trivial) id const concat or and boolToString mergeAttrs + flip mapNullable inNixShell min max importJSON warn info + nixpkgsVersion mod; + + inherit (fixedPoints) fix fix' extends composeExtensions + makeExtensible makeExtensibleWithCustomName; + inherit (attrsets) attrByPath hasAttrByPath setAttrByPath + getAttrFromPath attrVals attrValues catAttrs filterAttrs + filterAttrsRecursive foldAttrs collect nameValuePair mapAttrs + mapAttrs' mapAttrsToList mapAttrsRecursive mapAttrsRecursiveCond + genAttrs isDerivation toDerivation optionalAttrs + zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil + recursiveUpdate matchAttrs overrideExisting getOutput getBin + getLib getDev chooseDevOutputs zipWithNames zip; + inherit (lists) singleton foldr fold foldl foldl' imap0 imap1 + concatMap flatten remove findSingle findFirst any all count + optional optionals toList range partition zipListsWith zipLists + reverseList listDfs toposort sort take drop sublist last init + crossLists unique intersectLists subtractLists + mutuallyExclusive; + inherit (strings) concatStrings concatMapStrings concatImapStrings + intersperse concatStringsSep concatMapStringsSep + concatImapStringsSep makeSearchPath makeSearchPathOutput + makeLibraryPath makeBinPath makePerlPath optionalString + hasPrefix hasSuffix stringToCharacters stringAsChars escape + escapeShellArg escapeShellArgs replaceChars lowerChars upperChars + toLower toUpper addContextFrom splitString removePrefix + removeSuffix versionOlder versionAtLeast getVersion nameFromURL + enableFeature fixedWidthString fixedWidthNumber isStorePath + toInt readPathsFromFile fileContents; + inherit (stringsWithDeps) textClosureList textClosureMap + noDepEntry fullDepEntry packEntry stringAfter; + inherit (customisation) overrideDerivation makeOverridable + callPackageWith callPackagesWith addPassthru hydraJob makeScope; + inherit (meta) addMetaAttrs dontDistribute setName updateName + appendToName mapDerivationAttrset lowPrio lowPrioSet hiPrio + hiPrioSet; + inherit (sources) pathType pathIsDirectory cleanSourceFilter + cleanSource sourceByRegex sourceFilesBySuffices + commitIdFromGitRepo cleanSourceWith pathHasContext canCleanSource; + inherit (modules) evalModules closeModules unifyModuleSyntax + applyIfFunction unpackSubmodule packSubmodule mergeModules + mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions + pushDownProperties dischargeProperties filterOverrides + sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride + mkOptionDefault mkDefault mkForce mkVMOverride mkStrict + mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions + mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule + mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule + mkAliasOptionModule doRename filterModules; + inherit (options) isOption mkEnableOption mkSinkUndeclaredOptions + mergeDefaultOption mergeOneOption mergeEqualOption getValues + getFiles optionAttrSetToDocList optionAttrSetToDocList' + scrubOptionValue literalExample showOption showFiles + unknownModule mkOption; + inherit (types) isType setType defaultTypeMerge defaultFunctor + isOptionType mkOptionType; + inherit (debug) addErrorContextToAttrs traceIf traceVal + traceXMLVal traceXMLValMarked traceSeq traceSeqN traceValSeq + traceValSeqN traceShowVal traceShowValMarked + showVal traceCall traceCall2 traceCall3 traceValIfNot runTests + testAllTrue strict traceCallXml attrNamesToStr; + inherit (misc) maybeEnv defaultMergeArg defaultMerge foldArgs + defaultOverridableDelayableArgs composedArgsAndFun + maybeAttrNullable maybeAttr ifEnable checkFlag getValue + checkReqs uniqList uniqListExt condConcat lazyGenericClosure + innerModifySumArgs modifySumArgs innerClosePropagation + closePropagation mapAttrsFlatten nvs setAttr setAttrMerge + mergeAttrsWithFunc mergeAttrsConcatenateValues + mergeAttrsNoOverride mergeAttrByFunc mergeAttrsByFuncDefaults + mergeAttrsByFuncDefaultsClean mergeAttrBy + prepareDerivationArgs nixType imap overridableDelayableArgs; + }; +in lib diff --git a/lib/deprecated.nix b/lib/deprecated.nix index 8cdfab381baf..2a0f5a55bf14 100644 --- a/lib/deprecated.nix +++ b/lib/deprecated.nix @@ -1,11 +1,12 @@ -let lib = import ./default.nix; +{ lib }: +let inherit (builtins) isFunction head tail isList isAttrs isInt attrNames; in -with import ./lists.nix; -with import ./attrsets.nix; -with import ./strings.nix; +with lib.lists; +with lib.attrsets; +with lib.strings; rec { diff --git a/lib/fetchers.nix b/lib/fetchers.nix index 21f28c32ef7e..1107353b51dd 100644 --- a/lib/fetchers.nix +++ b/lib/fetchers.nix @@ -1,4 +1,5 @@ # snippets that can be shared by multiple fetchers (pkgs/build-support) +{ lib }: { proxyImpureEnvVars = [ diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 3925beb21347..fc35a1a72c64 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -1,3 +1,4 @@ +{ lib }: { # haskellPathsInDir : Path -> Map String Path # A map of all haskell packages defined in the given path, # identified by having a cabal file with the same name as the diff --git a/lib/fixed-points.nix b/lib/fixed-points.nix index a11b5a6f4bdc..13e053b5aa7d 100644 --- a/lib/fixed-points.nix +++ b/lib/fixed-points.nix @@ -1,3 +1,4 @@ +{ ... }: rec { # Compute the fixed point of the given function `f`, which is usually an # attribute set that expects its final, non-recursive representation as an diff --git a/lib/generators.nix b/lib/generators.nix index 4419c3c88917..f207033c9554 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -7,10 +7,11 @@ * Tests can be found in ./tests.nix * Documentation in the manual, #sec-generators */ -with import ./trivial.nix; +{ lib }: +with (lib).trivial; let - libStr = import ./strings.nix; - libAttr = import ./attrsets.nix; + libStr = lib.strings; + libAttr = lib.attrsets; flipMapAttrs = flip libAttr.mapAttrs; in @@ -21,11 +22,15 @@ rec { * character sep. If sep appears in k, it is escaped. * Helper for synaxes with different separators. * - * mkKeyValueDefault ":" "f:oo" "bar" + * mkValueString specifies how values should be formatted. + * + * mkKeyValueDefault {} ":" "f:oo" "bar" * > "f\:oo:bar" */ - mkKeyValueDefault = sep: k: v: - "${libStr.escape [sep] k}${sep}${toString v}"; + mkKeyValueDefault = { + mkValueString ? toString + }: sep: k: v: + "${libStr.escape [sep] k}${sep}${mkValueString v}"; /* Generate a key-value-style config file from an attrset. @@ -33,7 +38,7 @@ rec { * mkKeyValue is the same as in toINI. */ toKeyValue = { - mkKeyValue ? mkKeyValueDefault "=" + mkKeyValue ? mkKeyValueDefault {} "=" }: attrs: let mkLine = k: v: mkKeyValue k v + "\n"; in libStr.concatStrings (libAttr.mapAttrsToList mkLine attrs); @@ -63,7 +68,7 @@ rec { # apply transformations (e.g. escapes) to section names mkSectionName ? (name: libStr.escape [ "[" "]" ] name), # format a setting line from key and value - mkKeyValue ? mkKeyValueDefault "=" + mkKeyValue ? mkKeyValueDefault {} "=" }: attrsOfAttrs: let # map function to string for each key val @@ -125,6 +130,6 @@ rec { (name: value: "${toPretty args name} = ${toPretty args value};") v) + " }" - else "toPretty: should never happen (v = ${v})"; + else abort "toPretty: should never happen (v = ${v})"; } diff --git a/lib/licenses.nix b/lib/licenses.nix index e85aac8d440b..1fdcc15fd725 100644 --- a/lib/licenses.nix +++ b/lib/licenses.nix @@ -1,7 +1,6 @@ +{ lib }: let - lib = import ./default.nix; - spdx = lic: lic // { url = "http://spdx.org/licenses/${lic.spdxId}"; }; @@ -16,7 +15,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { afl21 = spdx { spdxId = "AFL-2.1"; - fullName = "Academic Free License"; + fullName = "Academic Free License v2.1"; + }; + + afl3 = spdx { + spdxId = "AFL-3.0"; + fullName = "Academic Free License v3.0"; }; agpl3 = spdx { @@ -175,6 +179,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { fullName = "DOC License"; }; + eapl = { + fullName = "EPSON AVASYS PUBLIC LICENSE"; + url = http://avasys.jp/hp/menu000000700/hpg000000603.htm; + free = false; + }; + efl10 = spdx { spdxId = "EFL-1.0"; fullName = "Eiffel Forum License v1.0"; @@ -211,6 +221,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { fullName = "GNU Free Documentation License v1.3"; }; + ffsl = { + fullName = "Floodgap Free Software License"; + url = http://www.floodgap.com/software/ffsl/license.html; + free = false; + }; + free = { fullName = "Unspecified free software license"; }; @@ -271,6 +287,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { url = https://fedoraproject.org/wiki/Licensing/GPL_Classpath_Exception; }; + hpnd = spdx { + spdxId = "HPND"; + fullName = "Historic Permission Notice and Disclaimer"; + }; + # Intel's license, seems free iasl = { fullName = "iASL"; @@ -282,9 +303,16 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { fullName = "Independent JPEG Group License"; }; - inria = { - fullName = "INRIA Non-Commercial License Agreement"; + inria-compcert = { + fullName = "INRIA Non-Commercial License Agreement for the CompCert verified compiler"; url = "http://compcert.inria.fr/doc/LICENSE"; + free = false; + }; + + inria-icesl = { + fullName = "INRIA Non-Commercial License Agreement for IceSL"; + url = "http://shapeforge.loria.fr/icesl/EULA_IceSL_binary.pdf"; + free = false; }; ipa = spdx { @@ -408,7 +436,12 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { url = "https://raw.githubusercontent.com/raboof/notion/master/LICENSE"; fullName = "Notion modified LGPL"; }; - + + nposl3 = spdx { + spdxId = "NPOSL-3.0"; + fullName = "Non-Profit Open Software License 3.0"; + }; + ofl = spdx { spdxId = "OFL-1.1"; fullName = "SIL Open Font License 1.1"; @@ -424,6 +457,16 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { fullName = "OpenSSL License"; }; + osl21 = spdx { + spdxId = "OSL-2.1"; + fullName = "Open Software License 2.1"; + }; + + osl3 = spdx { + spdxId = "OSL-3.0"; + fullName = "Open Software License 3.0"; + }; + php301 = spdx { spdxId = "PHP-3.01"; fullName = "PHP License v3.01"; diff --git a/lib/lists.nix b/lib/lists.nix index 6a8fd8a18408..8f67c6bb0ca3 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -1,6 +1,6 @@ # General list operations. - -with import ./trivial.nix; +{ lib }: +with lib.trivial; rec { diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 85669a28c281..de652bc30f4f 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -1,3 +1,4 @@ +{ ...}: /* List of NixOS maintainers. The format is: handle = "Real Name <address@example.org>"; @@ -27,9 +28,12 @@ afranchuk = "Alex Franchuk <alex.franchuk@gmail.com>"; aherrmann = "Andreas Herrmann <andreash87@gmx.ch>"; ahmedtd = "Taahir Ahmed <ahmed.taahir@gmail.com>"; + aij = "Ivan Jager <aij+git@mrph.org>"; + ajgrf = "Alex Griffin <a@ajgrf.com>"; ak = "Alexander Kjeldaas <ak@formalprivacy.com>"; akaWolf = "Artjom Vejsel <akawolf0@gmail.com>"; akc = "Anders Claesson <akc@akc.is>"; + alexvorobiev = "Alex Vorobiev <alexander.vorobiev@gmail.com"; algorith = "Dries Van Daele <dries_van_daele@telenet.be>"; alibabzo = "Alistair Bill <alistair.bill@gmail.com>"; all = "Nix Committers <nix-commits@lists.science.uu.nl>"; @@ -40,12 +44,15 @@ amorsillo = "Andrew Morsillo <andrew.morsillo@gmail.com>"; AndersonTorres = "Anderson Torres <torres.anderson.85@gmail.com>"; anderspapitto = "Anders Papitto <anderspapitto@gmail.com>"; + andir = "Andreas Rammhold <andreas@rammhold.de>"; andres = "Andres Loeh <ksnixos@andres-loeh.de>"; + andrestylianos = "Andre S. Ramos <andre.stylianos@gmail.com>"; andrewrk = "Andrew Kelley <superjoe30@gmail.com>"; andsild = "Anders Sildnes <andsild@gmail.com>"; aneeshusa = "Aneesh Agrawal <aneeshusa@gmail.com>"; ankhers = "Justin Wood <justin.k.wood@gmail.com>"; antono = "Antono Vasiljev <self@antono.info>"; + antonxy = "Anton Schirg <anton.schirg@posteo.de>"; apeschar = "Albert Peschar <albert@peschar.net>"; apeyroux = "Alexandre Peyroux <alex@px.io>"; ardumont = "Antoine R. Dumont <eniotna.t@gmail.com>"; @@ -57,22 +64,25 @@ asppsa = "Alastair Pharo <asppsa@gmail.com>"; astsmtl = "Alexander Tsamutali <astsmtl@yandex.ru>"; asymmetric = "Lorenzo Manacorda <lorenzo@mailbox.org>"; - aszlig = "aszlig <aszlig@redmoonstudios.org>"; + aszlig = "aszlig <aszlig@nix.build>"; auntie = "Jonathan Glines <auntieNeo@gmail.com>"; avnik = "Alexander V. Nikolaev <avn@avnik.info>"; aycanirican = "Aycan iRiCAN <iricanaycan@gmail.com>"; bachp = "Pascal Bach <pascal.bach@nextrem.ch>"; + backuitist = "Bruno Bieth"; badi = "Badi' Abdul-Wahid <abdulwahidc@gmail.com>"; - balajisivaraman = "Balaji Sivaraman<sivaraman.balaji@gmail.com>"; + balajisivaraman = "Balaji Sivaraman <sivaraman.balaji@gmail.com>"; barrucadu = "Michael Walker <mike@barrucadu.co.uk>"; basvandijk = "Bas van Dijk <v.dijk.bas@gmail.com>"; Baughn = "Svein Ove Aas <sveina@gmail.com>"; bcarrell = "Brandon Carrell <brandoncarrell@gmail.com>"; bcdarwin = "Ben Darwin <bcdarwin@gmail.com>"; bdimcheff = "Brandon Dimcheff <brandon@dimcheff.com>"; + bendlas = "Herwig Hochleitner <herwig@bendlas.net>"; benley = "Benjamin Staffin <benley@gmail.com>"; bennofs = "Benno Fünfstück <benno.fuenfstueck@gmail.com>"; benwbooth = "Ben Booth <benwbooth@gmail.com>"; + berce = "Bert Moens <bert.moens@gmail.com>"; berdario = "Dario Bertini <berdario@gmail.com>"; bergey = "Daniel Bergey <bergey@teallabs.org>"; bhipple = "Benjamin Hipple <bhipple@protonmail.com>"; @@ -88,7 +98,9 @@ bradediger = "Brad Ediger <brad@bradediger.com>"; bramd = "Bram Duvigneau <bram@bramd.nl>"; bstrik = "Berno Strik <dutchman55@gmx.com>"; + bugworm = "Roman Gerasimenko <bugworm@zoho.com>"; bzizou = "Bruno Bzeznik <Bruno@bzizou.net>"; + c0bw3b = "Renaud <c0bw3b@gmail.com>"; c0dehero = "CodeHero <codehero@nerdpol.ch>"; calbrecht = "Christian Albrecht <christian.albrecht@mayflower.de>"; calrama = "Moritz Maxeiner <moritz@ucworks.org>"; @@ -97,18 +109,25 @@ canndrew = "Andrew Cann <shum@canndrew.org>"; carlsverre = "Carl Sverre <accounts@carlsverre.com>"; casey = "Casey Rodarmor <casey@rodarmor.net>"; + catern = "Spencer Baugh <sbaugh@catern.com>"; caugner = "Claas Augner <nixos@caugner.de>"; cdepillabout = "Dennis Gosnell <cdep.illabout@gmail.com>"; cfouche = "Chaddaï Fouché <chaddai.fouche@gmail.com>"; changlinli = "Changlin Li <mail@changlinli.com>"; chaoflow = "Florian Friesdorf <flo@chaoflow.net>"; chattered = "Phil Scott <me@philscotted.com>"; + ChengCat = "Yucheng Zhang <yu@cheng.cat>"; choochootrain = "Hurshal Patel <hurshal@imap.cc>"; + chpatrick = "Patrick Chilton <chpatrick@gmail.com>"; + chreekat = "Bryan Richter <b@chreekat.net>"; chris-martin = "Chris Martin <ch.martin@gmail.com>"; chrisjefferson = "Christopher Jefferson <chris@bubblescope.net>"; + chrisrosset = "Christopher Rosset <chris@rosset.org.uk>"; christopherpoole = "Christopher Mark Poole <mail@christopherpoole.net>"; ciil = "Simon Lackerbauer <simon@lackerbauer.com>"; + ck3d = "Christian Kögler <ck3d@gmx.de>"; ckampka = "Christian Kampka <christian@kampka.net>"; + ckauhaus = "Christian Kauhaus <kc@flyingcircus.io>"; cko = "Christine Koppelt <christine.koppelt@gmail.com>"; cleverca22 = "Michael Bishop <cleverca22@gmail.com>"; cmcdragonkai = "Roger Qiu <roger.qiu@matrix.ai>"; @@ -128,12 +147,15 @@ cryptix = "Henry Bubert <cryptix@riseup.net>"; CrystalGamma = "Jona Stubbe <nixos@crystalgamma.de>"; cstrahan = "Charles Strahan <charles@cstrahan.com>"; + csingley = "Christopher Singley <csingley@gmail.com>"; cwoac = "Oliver Matthews <oliver@codersoffortune.net>"; DamienCassou = "Damien Cassou <damien@cassou.me>"; danbst = "Danylo Hlynskyi <abcz2.uprola@gmail.com>"; dancek = "Hannu Hartikainen <hannu.hartikainen@gmail.com>"; + danharaj = "Dan Haraj <dan@obsidian.systems>"; danielfullmer = "Daniel Fullmer <danielrf12@gmail.com>"; dasuxullebt = "Christoph-Simon Senjak <christoph.senjak@googlemail.com>"; + david50407 = "David Kuo <me@davy.tw>"; davidak = "David Kleuker <post@davidak.de>"; davidrusu = "David Rusu <davidrusu.me@gmail.com>"; davorb = "Davor Babic <davor@davor.se>"; @@ -153,6 +175,7 @@ dgonyeo = "Derek Gonyeo <derek@gonyeo.com>"; dipinhora = "Dipin Hora <dipinhora+github@gmail.com>"; disassembler = "Samuel Leathers <disasm@gmail.com>"; + dizfer = "David Izquierdo <david@izquierdofernandez.com>"; dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>"; DmitryTsygankov = "Dmitry Tsygankov <dmitry.tsygankov@gmail.com>"; dmjio = "David Johnson <djohnson.m@gmail.com>"; @@ -161,13 +184,17 @@ dotlambda = "Robert Schütz <rschuetz17@gmail.com>"; doublec = "Chris Double <chris.double@double.co.nz>"; dpaetzel = "David Pätzel <david.a.paetzel@gmail.com>"; + dpflug = "David Pflug <david@pflug.email>"; drets = "Dmytro Rets <dmitryrets@gmail.com>"; drewkett = "Andrew Burkett <burkett.andrew@gmail.com>"; dsferruzza = "David Sferruzza <david.sferruzza@gmail.com>"; dtzWill = "Will Dietz <nix@wdtz.org>"; + dupgit = "Olivier Delhomme <olivier.delhomme@free.fr>"; dywedir = "Vladyslav M. <dywedir@protonmail.ch>"; + dzabraev = "Maksim Dzabraev <dzabraew@gmail.com>"; e-user = "Alexander Kahl <nixos@sodosopa.io>"; - ebzzry = "Rommel Martinez <ebzzry@gmail.com>"; + earldouglas = "James Earl Douglas <james@earldouglas.com>"; + ebzzry = "Rommel Martinez <ebzzry@ebzzry.io>"; edanaher = "Evan Danaher <nixos@edanaher.net>"; edef = "edef <edef@edef.eu>"; ederoyd46 = "Matthew Brown <matt@ederoyd.co.uk>"; @@ -183,19 +210,27 @@ elijahcaine = "Elijah Caine <elijahcainemv@gmail.com>"; elitak = "Eric Litak <elitak@gmail.com>"; ellis = "Ellis Whitehead <nixos@ellisw.net>"; + enzime = "Michael Hoang <enzime@users.noreply.github.com>"; eperuffo = "Emanuele Peruffo <info@emanueleperuffo.com>"; epitrochoid = "Mabry Cervin <mpcervin@uncg.edu>"; + eqyiel = "Ruben Maher <r@rkm.id.au>"; ericbmerritt = "Eric Merritt <eric@afiniate.com>"; ericsagnes = "Eric Sagnes <eric.sagnes@gmail.com>"; + ericson2314 = "John Ericson <John.Ericson@Obsidian.Systems>"; + erictapen = "Justin Humm <justin.humm@posteo.de>"; erikryb = "Erik Rybakken <erik.rybakken@math.ntnu.no>"; ertes = "Ertugrul Söylemez <esz@posteo.de>"; ethercrow = "Dmitry Ivanov <ethercrow@gmail.com>"; + etu = "Elis Hirwing <elis@hirwing.se>"; exi = "Reno Reckling <nixos@reckling.org>"; exlevan = "Alexey Levan <exlevan@gmail.com>"; expipiplus1 = "Joe Hermaszewski <nix@monoid.al>"; fadenb = "Tristan Helmich <tristan.helmich+nixos@gmail.com>"; - fare = "Francois-Rene Rideau <fahree@gmail.com>"; falsifian = "James Cook <james.cook@utoronto.ca>"; + fare = "Francois-Rene Rideau <fahree@gmail.com>"; + fgaz = "Francesco Gazzetta <francygazz@gmail.com>"; + FireyFly = "Jonas Höglund <nix@firefly.nu>"; + flokli = "Florian Klink <flokli@flokli.de>"; florianjacob = "Florian Jacob <projects+nixos@florianjacob.de>"; flosse = "Markus Kohlhase <mail@markus-kohlhase.de>"; fluffynukeit = "Daniel Austin <dan@fluffynukeit.com>"; @@ -234,13 +269,16 @@ grburst = "Julius Elias <grburst@openmailbox.org>"; gridaphobe = "Eric Seidel <eric@seidel.io>"; guibert = "David Guibert <david.guibert@gmail.com>"; + guibou = "Guillaume Bouchard <guillaum.bouchard@gmail.com>"; guillaumekoenig = "Guillaume Koenig <guillaume.edward.koenig@gmail.com>"; guyonvarch = "Joris Guyonvarch <joris@guyonvarch.me>"; hakuch = "Jesse Haber-Kucharsky <hakuch@gmail.com>"; + hamhut1066 = "Hamish Hutchings <github@hamhut1066.com>"; havvy = "Ryan Scheel <ryan.havvy@gmail.com>"; hbunke = "Hendrik Bunke <bunke.hendrik@gmail.com>"; hce = "Hans-Christian Esperer <hc@hcesperer.org>"; hectorj = "Hector Jusforgues <hector.jusforgues+nixos@gmail.com>"; + hedning = "Tor Hedin Brønner <torhedinbronner@gmail.com>"; heel = "Sergii Paryzhskyi <parizhskiy@gmail.com>"; henrytill = "Henry Till <henrytill@gmail.com>"; hhm = "hhm <heehooman+nixpkgs@gmail.com>"; @@ -248,13 +286,18 @@ hodapp = "Chris Hodapp <hodapp87@gmail.com>"; hrdinka = "Christoph Hrdinka <c.nix@hrdinka.at>"; htr = "Hugo Tavares Reis <hugo@linux.com>"; + hyphon81 = "Masato Yonekawa <zero812n@gmail.com>"; iand675 = "Ian Duncan <ian@iankduncan.com>"; ianwookim = "Ian-Woo Kim <ianwookim@gmail.com>"; + iblech = "Ingo Blechschmidt <iblech@speicherleck.de>"; igsha = "Igor Sharonov <igor.sharonov@gmail.com>"; ikervagyok = "Balázs Lengyel <ikervagyok@gmail.com>"; + ilya-kolpakov = "Ilya Kolpakov <ilya.kolpakov@gmail.com>"; infinisil = "Silvan Mosberger <infinisil@icloud.com>"; ironpinguin = "Michele Catalano <michele@catalano.de>"; ivan-tkatchev = "Ivan Tkatchev <tkatchev@gmail.com>"; + ixmatus = "Parnell Springmeyer <parnell@digitalmentat.com>"; + izorkin = "Yurii Izorkin <Izorkin@gmail.com>"; j-keck = "Jürgen Keck <jhyphenkeck@gmail.com>"; jagajaga = "Arseniy Seroka <ars.seroka@gmail.com>"; jammerful = "jammerful <jammerful@gmail.com>"; @@ -281,10 +324,12 @@ joelmo = "Joel Moberg <joel.moberg@gmail.com>"; joelteon = "Joel Taylor <me@joelt.io>"; johbo = "Johannes Bornhold <johannes@bornhold.name>"; + johnmh = "John M. Harris, Jr. <johnmh@openblox.org>"; johnramsden = "John Ramsden <johnramsden@riseup.net>"; joko = "Ioannis Koutras <ioannis.koutras@gmail.com>"; jonafato = "Jon Banafato <jon@jonafato.com>"; - jpbernardy = "Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>"; + joncojonathan = "Jonathan Haddock <joncojonathan@gmail.com>"; + jpdoyle = "Joe Doyle <joethedoyle@gmail.com>"; jpierre03 = "Jean-Pierre PRUNARET <nix@prunetwork.fr>"; jpotier = "Martin Potier <jpo.contributes.to.nixos@marvid.fr>"; jraygauthier = "Raymond Gauthier <jraygauthier@gmail.com>"; @@ -292,29 +337,35 @@ juliendehos = "Julien Dehos <dehos@lisic.univ-littoral.fr>"; jwiegley = "John Wiegley <johnw@newartisans.com>"; jwilberding = "Jordan Wilberding <jwilberding@afiniate.com>"; + jyp = "Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>"; jzellner = "Jeff Zellner <jeffz@eml.cc>"; kaiha = "Kai Harries <kai.harries@gmail.com>"; kamilchm = "Kamil Chmielewski <kamil.chm@gmail.com>"; kampfschlaefer = "Arnold Krille <arnold@arnoldarts.de>"; + karolchmist = "karolchmist <info+nix@chmist.com>"; kentjames = "James Kent <jameschristopherkent@gmail.com"; kevincox = "Kevin Cox <kevincox@kevincox.ca>"; khumba = "Bryan Gardiner <bog@khumba.net>"; KibaFox = "Kiba Fox <kiba.fox@foxypossibilities.com>"; kierdavis = "Kier Davis <kierdavis@gmail.com>"; kiloreux = "Kiloreux Emperex <kiloreux@gmail.com>"; + kini = "Keshav Kini <keshav.kini@gmail.com>"; kkallio = "Karn Kallio <tierpluspluslists@gmail.com>"; knedlsepp = "Josef Kemetmüller <josef.kemetmueller@gmail.com>"; - konimex = "Muhammad Herdiansyah <herdiansyah@openmailbox.org>"; + konimex = "Muhammad Herdiansyah <herdiansyah@netc.eu>"; koral = "Koral <koral@mailoo.org>"; kovirobi = "Kovacsics Robert <kovirobi@gmail.com>"; + kquick = "Kevin Quick <quick@sparq.org>"; kragniz = "Louis Taylor <louis@kragniz.eu>"; kristoff3r = "Kristoffer Søholm <k.soeholm@gmail.com>"; ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>"; + kuznero = "Roman Kuznetsov <roman@kuznero.com>"; lassulus = "Lassulus <lassulus@gmail.com>"; layus = "Guillaume Maudoux <layus.on@gmail.com>"; ldesgoui = "Lucas Desgouilles <ldesgoui@gmail.com>"; league = "Christopher League <league@contrapunctus.net>"; lebastr = "Alexander Lebedev <lebastr@gmail.com>"; + ledif = "Adam Fidel <refuse@gmail.com>"; leemachin = "Lee Machin <me@mrl.ee>"; leenaars = "Michiel Leenaars <ml.software@leenaa.rs>"; leonardoce = "Leonardo Cecchi <leonardo.cecchi@gmail.com>"; @@ -327,15 +378,18 @@ linus = "Linus Arver <linusarver@gmail.com>"; lluchs = "Lukas Werling <lukas.werling@gmail.com>"; lnl7 = "Daiderd Jordan <daiderd@gmail.com>"; + lo1tuma = "Mathias Schreck <schreck.mathias@gmail.com>"; loskutov = "Ignat Loskutov <ignat.loskutov@gmail.com>"; lovek323 = "Jason O'Conal <jason@oconal.id.au>"; lowfatcomputing = "Andreas Wagner <andreas.wagner@lowfatcomputing.org>"; lsix = "Lancelot SIX <lsix@lancelotsix.com>"; + ltavard = "Laure Tavard <laure.tavard@univ-grenoble-alpes.fr>"; lucas8 = "Luc Chabassier <luc.linux@mailoo.org>"; ludo = "Ludovic Courtès <ludo@gnu.org>"; lufia = "Kyohei Kadota <lufia@lufia.org>"; luispedro = "Luis Pedro Coelho <luis@luispedro.org>"; lukego = "Luke Gorrie <luke@snabb.co>"; + luz = "Luz <luz666@daum.net>"; lw = "Sergey Sofeychuk <lw@fmap.me>"; lyt = "Tim Liou <wheatdoge@gmail.com>"; m3tti = "Mathaeus Sander <mathaeus.peter.sander@gmail.com>"; @@ -348,6 +402,7 @@ manveru = "Michael Fellinger <m.fellinger@gmail.com>"; marcweber = "Marc Weber <marco-oweber@gmx.de>"; markus1189 = "Markus Hauck <markus1189@gmail.com>"; + markuskowa = "Markus Kowalewski <markus.kowalewski@gmail.com>"; markWot = "Markus Wotringer <markus@wotringer.de>"; martijnvermaat = "Martijn Vermaat <martijn@vermaat.name>"; martingms = "Martin Gammelsæter <martin@mg.am>"; @@ -359,31 +414,39 @@ mbakke = "Marius Bakke <mbakke@fastmail.com>"; mbbx6spp = "Susan Potter <me@susanpotter.net>"; mbe = "Brandon Edens <brandonedens@gmail.com>"; + mbode = "Maximilian Bode <maxbode@gmail.com>"; mboes = "Mathieu Boespflug <mboes@tweag.net>"; mbrgm = "Marius Bergmann <marius@yeai.de>"; mcmtroffaes = "Matthias C. M. Troffaes <matthias.troffaes@gmail.com>"; mdaiter = "Matthew S. Daiter <mdaiter8121@gmail.com>"; meditans = "Carlo Nucera <meditans@gmail.com>"; + mehandes = "Matt Deming <niewskici@gmail.com>"; meisternu = "Matt Miemiec <meister@krutt.org>"; metabar = "Celine Mercier <softs@metabarcoding.org>"; + mgdelacroix = "Miguel de la Cruz <mgdelacroix@gmail.com>"; + mgttlinger = "Merlin Göttlinger <megoettlinger@gmail.com"; mguentner = "Maximilian Güntner <code@klandest.in>"; mic92 = "Jörg Thalheim <joerg@thalheim.io>"; michaelpj = "Michael Peyton Jones <michaelpj@gmail.com>"; michalrus = "Michal Rus <m@michalrus.com>"; michelk = "Michel Kuhlmann <michel@kuhlmanns.info>"; + mickours = "Michael Mercier <mickours@gmail.com<"; midchildan = "midchildan <midchildan+nix@gmail.com>"; mikefaille = "Michaël Faille <michael@faille.io>"; + mikoim = "Eshin Kunishima <ek@esh.ink>"; miltador = "Vasiliy Solovey <miltador@yandex.ua>"; mimadrid = "Miguel Madrid <mimadrid@ucm.es>"; - mingchuan = "Ming Chuan <ming@culpring.com>"; mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>"; mirrexagon = "Andrew Abbott <mirrexagon@mirrexagon.com>"; mjanczyk = "Marcin Janczyk <m@dragonvr.pl>"; + mjp = "Mike Playle <mike@mythik.co.uk>"; # github = "MikePlayle"; mlieberman85 = "Michael Lieberman <mlieberman85@gmail.com>"; + moaxcp = "John Mercier <moaxcp@gmail.com>"; modulistic = "Pablo Costa <modulistic@gmail.com>"; mog = "Matthew O'Gorman <mog-lists@rldn.net>"; montag451 = "montag451 <montag451@laposte.net>"; moosingin3space = "Nathan Moos <moosingin3space@gmail.com>"; + moredread = "André-Patrick Bubel <code@apb.name>"; moretea = "Maarten Hoogendoorn <maarten@moretea.nl>"; mornfall = "Petr Ročkai <me@mornfall.net>"; MostAwesomeDude = "Corbin Simpson <cds@corbinsimpson.com>"; @@ -392,8 +455,10 @@ mpcsh = "Mark Cohen <m@mpc.sh>"; mpscholten = "Marc Scholten <marc@mpscholten.de>"; mpsyco = "Francis St-Amour <fr.st-amour@gmail.com>"; + mrVanDalo = "Ingolf Wanger <contact@ingolf-wagner.de>"; msackman = "Matthew Sackman <matthew@wellquite.org>"; mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>"; + mstarzyk = "Maciek Starzyk <mstarzyk@gmail.com>"; msteen = "Matthijs Steen <emailmatthijs@gmail.com>"; mt-caret = "Masayuki Takeda <mtakeda.enigsol@gmail.com>"; mtreskin = "Max Treskin <zerthurd@gmail.com>"; @@ -415,7 +480,7 @@ nicknovitski = "Nick Novitski <nixpkgs@nicknovitski.com>"; nico202 = "Nicolò Balzarotti <anothersms@gmail.com>"; NikolaMandic = "Ratko Mladic <nikola@mandic.email>"; - nixy = "Andrew R. M. <andrewmiller237@gmail.com>"; + nixy = "Andrew R. M. <nixy@nixy.moe>"; nocoolnametom = "Tom Doggett <nocoolnametom@gmail.com>"; notthemessiah = "Brian Cohen <brian.cohen.88@gmail.com>"; np = "Nicolas Pouillard <np.nix@nicolaspouillard.fr>"; @@ -439,22 +504,24 @@ oxij = "Jan Malakhovski <oxij@oxij.org>"; paholg = "Paho Lurie-Gregg <paho@paholg.com>"; pakhfn = "Fedor Pakhomov <pakhfn@gmail.com>"; - palo = "Ingolf Wanger <palipalo9@googlemail.com>"; panaeon = "Vitalii Voloshyn <vitalii.voloshyn@gmail.com"; paperdigits = "Mica Semrick <mica@silentumbrella.com>"; pashev = "Igor Pashev <pashev.igor@gmail.com>"; patternspandemic = "Brad Christensen <patternspandemic@live.com>"; pawelpacana = "Paweł Pacana <pawel.pacana@gmail.com>"; pbogdan = "Piotr Bogdan <ppbogdan@gmail.com>"; + pcarrier = "Pierre Carrier <pc@rrier.ca>"; periklis = "theopompos@gmail.com"; pesterhazy = "Paulus Esterhazy <pesterhazy@gmail.com>"; peterhoeg = "Peter Hoeg <peter@hoeg.com>"; + peterromfeldhk = "Peter Romfeld <peter.romfeld.hk@gmail.com>"; peti = "Peter Simons <simons@cryp.to>"; philandstuff = "Philip Potter <philip.g.potter@gmail.com>"; phile314 = "Philipp Hausmann <nix@314.ch>"; Phlogistique = "Noé Rubinstein <noe.rubinstein@gmail.com>"; phreedom = "Evgeny Egorochkin <phreedom@yandex.ru>"; phunehehe = "Hoang Xuan Phu <phunehehe@gmail.com>"; + pierrechevalier83 = "Pierre Chevalier <pierrechevalier83@gmail.com>"; pierrer = "Pierre Radermecker <pierrer@pi3r.be>"; pierron = "Nicolas B. Pierron <nixos@nbp.name>"; piotr = "Piotr Pietraszkiewicz <ppietrasa@gmail.com>"; @@ -464,6 +531,7 @@ plcplc = "Philip Lykke Carlsen <plcplc@gmail.com>"; plumps = "Maksim Bronsky <maks.bronsky@web.de"; pmahoney = "Patrick Mahoney <pat@polycrystal.org>"; + pmeunier = "Pierre-Étienne Meunier <pierre-etienne.meunier@inria.fr>"; pmiddend = "Philipp Middendorf <pmidden@secure.mailbox.org>"; polyrod = "Maurizio Di Pietro <dc1mdp@gmail.com>"; pradeepchhetri = "Pradeep Chhetri <pradeep.chhetri89@gmail.com>"; @@ -484,6 +552,7 @@ rardiol = "Ricardo Ardissone <ricardo.ardissone@gmail.com>"; rasendubi = "Alexey Shmalko <rasen.dubi@gmail.com>"; raskin = "Michael Raskin <7c6f434c@mail.ru>"; + ravloony = "Tom Macdonald <ravloony@gmail.com>"; rbasso = "Rafael Basso <rbasso@sharpgeeks.net>"; redbaron = "Maxim Ivanov <ivanov.maxim@gmail.com>"; redvers = "Redvers Davies <red@infect.me>"; @@ -493,6 +562,7 @@ renzo = "Renzo Carbonara <renzocarbonara@gmail.com>"; retrry = "Tadas Barzdžius <retrry@gmail.com>"; rht = "rht <rhtbot@protonmail.com>"; + richardipsum = "Richard Ipsum <richardipsum@fastmail.co.uk>"; rick68 = "Wei-Ming Yang <rick68@gmail.com>"; rickynils = "Rickard Nilsson <rickynils@gmail.com>"; ris = "Robert Scott <code@humanleg.org.uk>"; @@ -502,6 +572,7 @@ robberer = "Longrin Wischnewski <robberer@freakmail.de>"; robbinch = "Robbin C. <robbinch33@gmail.com>"; roberth = "Robert Hensing <nixpkgs@roberthensing.nl>"; + robertodr = "Roberto Di Remigio <roberto.diremigio@gmail.com>"; robgssp = "Rob Glossop <robgssp@gmail.com>"; roblabla = "Robin Lambertz <robinlambertz+dev@gmail.com>"; roconnor = "Russell O'Connor <roconnor@theorem.ca>"; @@ -512,15 +583,18 @@ rushmorem = "Rushmore Mushambi <rushmore@webenchanter.com>"; rvl = "Rodney Lorrimar <dev+nix@rodney.id.au>"; rvlander = "Gaëtan André <rvlander@gaetanandre.eu>"; - rvolosatovs = "Roman Volosatovs <rvolosatovs@riseup.net"; + rvolosatovs = "Roman Volosatovs <rvolosatovs@riseup.net>"; ryanartecona = "Ryan Artecona <ryanartecona@gmail.com>"; ryansydnor = "Ryan Sydnor <ryan.t.sydnor@gmail.com>"; ryantm = "Ryan Mulligan <ryan@ryantm.com>"; + ryantrinkle = "Ryan Trinkle <ryan.trinkle@gmail.com>"; rybern = "Ryan Bernstein <ryan.bernstein@columbia.edu>"; rycee = "Robert Helgesson <robert@rycee.net>"; ryneeverett = "Ryne Everett <ryneeverett@gmail.com>"; rzetterberg = "Richard Zetterberg <richard.zetterberg@gmail.com>"; s1lvester = "Markus Silvester <s1lvester@bockhacker.me>"; + samdroid-apps = "Sam Parkinson <sam@sam.today>"; + samueldr = "Samuel Dionne-Riel <samuel@dionne-riel.com>"; samuelrivas = "Samuel Rivas <samuelrivas@gmail.com>"; sander = "Sander van der Burg <s.vanderburg@tudelft.nl>"; sargon = "Daniel Ehlers <danielehlers@mindeye.net>"; @@ -530,6 +604,7 @@ schristo = "Scott Christopher <schristopher@konputa.com>"; scolobb = "Sergiu Ivanov <sivanov@colimite.fr>"; sdll = "Sasha Illarionov <sasha.delly@gmail.com>"; + SeanZicari = "Sean Zicari <sean.zicari@gmail.com>"; sellout = "Greg Pfeil <greg@technomadic.org>"; sepi = "Raffael Mancini <raffael@mancini.lu>"; seppeljordan = "Sebastian Jordan <sebastian.jordan.mail@googlemail.com>"; @@ -540,8 +615,10 @@ shell = "Shell Turner <cam.turn@gmail.com>"; shlevy = "Shea Levy <shea@shealevy.com>"; siddharthist = "Langston Barrett <langston.barrett@gmail.com>"; + sifmelcara = "Ming Chuan <ming@culpring.com>"; sigma = "Yann Hodique <yann.hodique@gmail.com>"; simonvandel = "Simon Vandel Sillesen <simon.vandel@gmail.com>"; + sivteck = "Sivaram Balakrishnan <sivaram1992@gmail.com>"; sjagoe = "Simon Jagoe <simon@simonjagoe.com>"; sjmackenzie = "Stewart Mackenzie <setori88@gmail.com>"; sjourdois = "Stéphane ‘kwisatz’ Jourdois <sjourdois@gmail.com>"; @@ -552,6 +629,7 @@ snyh = "Xia Bin <snyh@snyh.org>"; solson = "Scott Olson <scott@solson.me>"; sorpaas = "Wei Tang <hi@that.world>"; + sorki = "Richard Marko <srk@48.io>"; spacefrogg = "Michael Raitza <spacefrogg-nixos@meterriblecrew.net>"; spencerjanssen = "Spencer Janssen <spencerjanssen@gmail.com>"; spinus = "Tomasz Czyż <tomasz.czyz@gmail.com>"; @@ -563,28 +641,39 @@ sternenseemann = "Lukas Epple <post@lukasepple.de>"; stesie = "Stefan Siegl <stesie@brokenpipe.de>"; steveej = "Stefan Junker <mail@stefanjunker.de>"; + StillerHarpo = "Florian Engel <florianengel39@gmail.com>"; + stumoss = "Stuart Moss <samoss@gmail.com>"; SuprDewd = "Bjarki Ágúst Guðmundsson <suprdewd@gmail.com>"; swarren83 = "Shawn Warren <shawn.w.warren@gmail.com>"; swflint = "Samuel W. Flint <swflint@flintfam.org>"; swistak35 = "Rafał Łasocha <me@swistak35.com>"; + symphorien = "Guillaume Girol <symphorien_nixpkgs@xlumurb.eu>"; szczyp = "Szczyp <qb@szczyp.com>"; sztupi = "Attila Sztupak <attila.sztupak@gmail.com>"; taeer = "Taeer Bar-Yam <taeer@necsi.edu>"; tailhook = "Paul Colomiets <paul@colomiets.name>"; + taketwo = "Sergey Alexandrov <alexandrov88@gmail.com>"; takikawa = "Asumu Takikawa <asumu@igalia.com>"; taktoa = "Remy Goldschmidt <taktoa@gmail.com>"; taku0 = "Takuo Yonezawa <mxxouy6x3m_github@tatapa.org>"; tari = "Peter Marheine <peter@taricorp.net>"; tavyc = "Octavian Cerna <octavian.cerna@gmail.com>"; - ltavard = "Laure Tavard <laure.tavard@univ-grenoble-alpes.fr>"; + TealG = "Teal Gaure <~@Teal.Gr>"; teh = "Tom Hunger <tehunger@gmail.com>"; telotortium = "Robert Irelan <rirelan@gmail.com>"; + teto = "Matthieu Coudron <mcoudron@hotmail.com>"; + tex = "Milan Svoboda <milan.svoboda@centrum.cz>"; thall = "Niclas Thall <niclas.thall@gmail.com>"; thammers = "Tobias Hammerschmidt <jawr@gmx.de>"; + thanegill = "Thane Gill <me@thanegill.com>"; the-kenny = "Moritz Ulrich <moritz@tarn-vedra.de>"; theuni = "Christian Theune <ct@flyingcircus.io>"; + ThomasMader = "Thomas Mader <thomas.mader@gmail.com>"; thoughtpolice = "Austin Seipp <aseipp@pobox.com>"; + thpham = "Thomas Pham <thomas.pham@ithings.ch>"; timbertson = "Tim Cuthbertson <tim@gfxmonk.net>"; + timokau = "Timo Kaufmann <timokau@zoho.com>"; + tiramiseb = "Sébastien Maccagnoni <sebastien@maccagnoni.eu>"; titanous = "Jonathan Rudenberg <jonathan@titanous.com>"; tnias = "Philipp Bartsch <phil@grmr.de>"; tohl = "Tomas Hlavaty <tom@logand.com>"; @@ -606,6 +695,7 @@ #urkud = "Yury G. Kudryashov <urkud+nix@ya.ru>"; inactive since 2012 uwap = "uwap <me@uwap.name>"; vaibhavsagar = "Vaibhav Sagar <vaibhavsagar@gmail.com>"; + valeriangalliat = "Valérian Galliat <val@codejam.info>"; vandenoever = "Jos van den Oever <jos@vandenoever.info>"; vanschelven = "Klaas van Schelven <klaas@vanschelven.com>"; vanzef = "Ivan Solyankin <vanzef@gmail.com>"; @@ -613,7 +703,9 @@ vbmithr = "Vincent Bernardoff <vb@luminar.eu.org>"; vcunat = "Vladimír Čunát <vcunat@gmail.com>"; vdemeester = "Vincent Demeester <vincent@sbr.pm>"; + velovix = "Tyler Compton <xaviosx@gmail.com>"; veprbl = "Dmitry Kalinkin <veprbl@gmail.com>"; + vidbina = "David Asabina <vid@bina.me>"; vifino = "Adrian Pistol <vifino@tty.sh>"; vinymeuh = "VinyMeuh <vinymeuh@gmail.com>"; viric = "Lluís Batlle i Rossell <viric@viric.name>"; @@ -622,7 +714,6 @@ vlstill = "Vladimír Štill <xstill@fi.muni.cz>"; vmandela = "Venkateswara Rao Mandela <venkat.mandela@gmail.com>"; vmchale = "Vanessa McHale <tmchale@wisc.edu>"; - valeriangalliat = "Valérian Galliat <val@codejam.info>"; volhovm = "Mikhail Volkhov <volhovm.cs@gmail.com>"; volth = "Jaroslavas Pocepko <jaroslavas@volth.com>"; vozz = "Oliver Hunt <oliver.huntuk@gmail.com>"; @@ -636,15 +727,21 @@ wjlroe = "William Roe <willroe@gmail.com>"; wkennington = "William A. Kennington III <william@wkennington.com>"; wmertens = "Wout Mertens <Wout.Mertens@gmail.com>"; + woffs = "Frank Doepper <github@woffs.de>"; womfoo = "Kranium Gikos Mendoza <kranium@gikos.net>"; wscott = "Wayne Scott <wsc9tt@gmail.com>"; wyvie = "Elijah Rum <elijahrum@gmail.com>"; + xaverdh = "Dominik Xaver Hörl <hoe.dom@gmx.de>"; xnwdd = "Guillermo NWDD <nwdd+nixos@no.team>"; xvapx = "Marti Serra <marti.serra.coscollano@gmail.com>"; xwvvvvwx = "David Terry <davidterry@posteo.de>"; + xzfc = "Albert Safin <xzfcpw@gmail.com>"; yarr = "Dmitry V. <savraz@gmail.com>"; + yegortimoshenko = "Yegor Timoshenko <yegortimoshenko@gmail.com>"; + ylwghst = "Burim Augustin Berisa <ylwghst@onionmail.info>"; yochai = "Yochai <yochai@titat.info>"; yorickvp = "Yorick van Pelt <yorickvanpelt@gmail.com>"; + yrashk = "Yurii Rashkovskii <yrashk@gmail.com>"; yuriaisaka = "Yuri Aisaka <yuri.aisaka+nix@gmail.com>"; yurrriq = "Eric Bailey <eric@ericb.me>"; z77z = "Marco Maggesi <maggesi@math.unifi.it>"; @@ -659,4 +756,5 @@ zoomulator = "Kim Simmons <zoomulator@gmail.com>"; zraexy = "David Mell <zraexy@gmail.com>"; zx2c4 = "Jason A. Donenfeld <Jason@zx2c4.com>"; + zzamboni = "Diego Zamboni <diego@zzamboni.org>"; } diff --git a/lib/meta.nix b/lib/meta.nix index 8f77bbe01484..07b1710fff70 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -1,8 +1,7 @@ /* Some functions for manipulating meta attributes, as well as the name attribute. */ -let lib = import ./default.nix; -in +{ lib }: rec { diff --git a/lib/modules.nix b/lib/modules.nix index 3da689a6bdb0..8c3584bbbf4c 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -1,10 +1,12 @@ -with import ./lists.nix; -with import ./strings.nix; -with import ./trivial.nix; -with import ./attrsets.nix; -with import ./options.nix; -with import ./debug.nix; -with import ./types.nix; +{ lib }: + +with lib.lists; +with lib.strings; +with lib.trivial; +with lib.attrsets; +with lib.options; +with lib.debug; +with lib.types; rec { @@ -336,7 +338,7 @@ rec { # Type-check the remaining definitions, and merge them. mergedValue = foldl' (res: def: if type.check def.value then res - else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.description}.") + else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'.") (type.merge loc defsFinal) defsFinal; isDefined = defsFinal != []; diff --git a/lib/options.nix b/lib/options.nix index 2092b65bbc3a..769d3cc55723 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -1,11 +1,10 @@ # Nixpkgs/NixOS option handling. +{ lib }: -let lib = import ./default.nix; in - -with import ./trivial.nix; -with import ./lists.nix; -with import ./attrsets.nix; -with import ./strings.nix; +with lib.trivial; +with lib.lists; +with lib.attrsets; +with lib.strings; rec { diff --git a/lib/sandbox.nix b/lib/sandbox.nix deleted file mode 100644 index 414bf36f779f..000000000000 --- a/lib/sandbox.nix +++ /dev/null @@ -1,47 +0,0 @@ -with import ./strings.nix; - -/* Helpers for creating lisp S-exprs for the Apple sandbox - -lib.sandbox.allowFileRead [ "/usr/bin/file" ]; - # => "(allow file-read* (literal \"/usr/bin/file\"))"; - -lib.sandbox.allowFileRead { - literal = [ "/usr/bin/file" ]; - subpath = [ "/usr/lib/system" ]; -} - # => "(allow file-read* (literal \"/usr/bin/file\") (subpath \"/usr/lib/system\"))" -*/ - -let - -sexp = tokens: "(" + builtins.concatStringsSep " " tokens + ")"; -generateFileList = files: - if builtins.isList files - then concatMapStringsSep " " (x: sexp [ "literal" ''"${x}"'' ]) files - else if builtins.isString files - then generateFileList [ files ] - else concatStringsSep " " ( - (map (x: sexp [ "literal" ''"${x}"'' ]) (files.literal or [])) ++ - (map (x: sexp [ "subpath" ''"${x}"'' ]) (files.subpath or [])) - ); -applyToFiles = f: act: files: f "${act} ${generateFileList files}"; -genActions = actionName: let - action = feature: sexp [ actionName feature ]; - self = { - "${actionName}" = action; - "${actionName}File" = applyToFiles action "file*"; - "${actionName}FileRead" = applyToFiles action "file-read*"; - "${actionName}FileReadMetadata" = applyToFiles action "file-read-metadata"; - "${actionName}DirectoryList" = self."${actionName}FileReadMetadata"; - "${actionName}FileWrite" = applyToFiles action "file-write*"; - "${actionName}FileWriteMetadata" = applyToFiles action "file-write-metadata"; - }; - in self; - -in - -genActions "allow" // genActions "deny" // { - importProfile = derivation: '' - (import "${derivation}") - ''; -} diff --git a/lib/sources.nix b/lib/sources.nix index 0ec4c020e545..704711b20cd9 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -1,6 +1,5 @@ # Functions for copying sources to the Nix store. - -let lib = import ./default.nix; in +{ lib }: rec { @@ -15,9 +14,10 @@ rec { cleanSourceFilter = name: type: let baseName = baseNameOf (toString name); in ! ( # Filter out Subversion and CVS directories. (type == "directory" && (baseName == ".git" || baseName == ".svn" || baseName == "CVS" || baseName == ".hg")) || - # Filter out backup files. + # Filter out editor backup / swap files. lib.hasSuffix "~" baseName || - builtins.match "^.*\.sw[a-z]$" baseName != null || + builtins.match "^\\.sw[a-z]$" baseName != null || + builtins.match "^\\..*\\.sw[a-z]$" baseName != null || # Filter out generates files. lib.hasSuffix ".o" baseName || @@ -26,14 +26,35 @@ rec { (type == "symlink" && lib.hasPrefix "result" baseName) ); - cleanSource = builtins.filterSource cleanSourceFilter; + cleanSource = src: cleanSourceWith { filter = cleanSourceFilter; inherit src; }; + + # Like `builtins.filterSource`, except it will compose with itself, + # allowing you to chain multiple calls together without any + # intermediate copies being put in the nix store. + # + # lib.cleanSourceWith f (lib.cleanSourceWith g ./.) # Succeeds! + # builtins.filterSource f (builtins.filterSource g ./.) # Fails! + cleanSourceWith = { filter, src }: + let + isFiltered = src ? _isLibCleanSourceWith; + origSrc = if isFiltered then src.origSrc else src; + filter' = if isFiltered then name: type: filter name type && src.filter name type else filter; + in { + inherit origSrc; + filter = filter'; + outPath = builtins.filterSource filter' origSrc; + _isLibCleanSourceWith = true; + }; # Filter sources by a list of regular expressions. # # E.g. `src = sourceByRegex ./my-subproject [".*\.py$" "^database.sql$"]` - sourceByRegex = src: regexes: builtins.filterSource (path: type: - let relPath = lib.removePrefix (toString src + "/") (toString path); - in lib.any (re: builtins.match re relPath != null) regexes) src; + sourceByRegex = src: regexes: cleanSourceWith { + filter = (path: type: + let relPath = lib.removePrefix (toString src + "/") (toString path); + in lib.any (re: builtins.match re relPath != null) regexes); + inherit src; + }; # Get all files ending with the specified suffices from the given # directory or its descendants. E.g. `sourceFilesBySuffices ./dir @@ -42,7 +63,7 @@ rec { let filter = name: type: let base = baseNameOf (toString name); in type == "directory" || lib.any (ext: lib.hasSuffix ext base) exts; - in builtins.filterSource filter path; + in cleanSourceWith { inherit filter; src = path; }; # Get the commit id of a git repo @@ -72,4 +93,8 @@ rec { else lib.head matchRef else throw ("Not a .git directory: " + path); in lib.flip readCommitFromFile "HEAD"; + + pathHasContext = builtins.hasContext or (lib.hasPrefix builtins.storeDir); + + canCleanSource = src: src ? _isLibCleanSourceWith || !(pathHasContext (toString src)); } diff --git a/lib/strings-with-deps.nix b/lib/strings-with-deps.nix index a901940ac12b..e3336983428f 100644 --- a/lib/strings-with-deps.nix +++ b/lib/strings-with-deps.nix @@ -1,3 +1,4 @@ +{ lib }: /* Usage: @@ -40,9 +41,9 @@ Usage: [1] maybe this behaviour should be removed to keep things simple (?) */ -with import ./lists.nix; -with import ./attrsets.nix; -with import ./strings.nix; +with lib.lists; +with lib.attrsets; +with lib.strings; rec { diff --git a/lib/strings.nix b/lib/strings.nix index a03694d1b1d7..9cbd1494a2b5 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -1,6 +1,6 @@ /* String manipulation functions. */ - -let lib = import ./default.nix; +{ lib }: +let inherit (builtins) length; @@ -219,6 +219,14 @@ rec { */ escapeShellArgs = concatMapStringsSep " " escapeShellArg; + /* Turn a string into a Nix expression representing that string + + Example: + escapeNixString "hello\${}\n" + => "\"hello\\\${}\\n\"" + */ + escapeNixString = s: escape ["$"] (builtins.toJSON s); + /* Obsolete - use replaceStrings instead. */ replaceChars = builtins.replaceStrings or ( del: new: s: diff --git a/lib/systems/default.nix b/lib/systems/default.nix index c22c99561969..b1036b80c4db 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -1,11 +1,12 @@ -let inherit (import ../attrsets.nix) mapAttrs; in +{ lib }: + let inherit (lib.attrsets) mapAttrs; in rec { - doubles = import ./doubles.nix; - parse = import ./parse.nix; - inspect = import ./inspect.nix; - platforms = import ./platforms.nix; - examples = import ./examples.nix; + doubles = import ./doubles.nix { inherit lib; }; + parse = import ./parse.nix { inherit lib; }; + inspect = import ./inspect.nix { inherit lib; }; + platforms = import ./platforms.nix { inherit lib; }; + examples = import ./examples.nix { inherit lib; }; # Elaborate a `localSystem` or `crossSystem` so that it contains everything # necessary. @@ -28,6 +29,15 @@ rec { else if final.isLinux then "glibc" # TODO(@Ericson2314) think more about other operating systems else "native/impure"; + extensions = { + sharedLibrary = + /**/ if final.isDarwin then ".dylib" + else if final.isWindows then ".dll" + else ".so"; + executable = + /**/ if final.isWindows then ".exe" + else ""; + }; } // mapAttrs (n: v: v final.parsed) inspect.predicates // args; in final; diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index ac1a199d80c4..0cae8ec56fdf 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -1,8 +1,9 @@ +{ lib }: let - lists = import ../lists.nix; - parse = import ./parse.nix; - inherit (import ./inspect.nix) predicates; - inherit (import ../attrsets.nix) matchAttrs; + inherit (lib) lists; + parse = import ./parse.nix { inherit lib; }; + inherit (import ./inspect.nix { inherit lib; }) predicates; + inherit (lib.attrsets) matchAttrs; all = [ "aarch64-linux" diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index e394f43831c9..90d7e956d2ba 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -1,8 +1,8 @@ # These can be passed to nixpkgs as either the `localSystem` or # `crossSystem`. They are put here for user convenience, but also used by cross # tests and linux cross stdenv building, so handle with care! - -let platforms = import ./platforms.nix; in +{ lib }: +let platforms = import ./platforms.nix { inherit lib; }; in rec { # @@ -18,7 +18,6 @@ rec { libc = "glibc"; platform = platforms.sheevaplug; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; raspberryPi = rec { @@ -31,7 +30,6 @@ rec { libc = "glibc"; platform = platforms.raspberrypi; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; armv7l-hf-multiplatform = rec { @@ -44,7 +42,6 @@ rec { libc = "glibc"; platform = platforms.armv7l-hf-multiplatform; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; aarch64-multiplatform = rec { @@ -54,23 +51,20 @@ rec { withTLS = true; libc = "glibc"; platform = platforms.aarch64-multiplatform; - inherit (platform) gcc; }; scaleway-c1 = armv7l-hf-multiplatform // rec { platform = platforms.scaleway-c1; - inherit (platform) gcc; - inherit (gcc) fpu; + inherit (platform.gcc) fpu; }; pogoplug4 = rec { arch = "armv5tel"; - config = "armv5tel-softfloat-linux-gnueabi"; + config = "armv5tel-unknown-linux-gnueabi"; float = "soft"; platform = platforms.pogoplug4; - inherit (platform) gcc; libc = "glibc"; withTLS = true; @@ -86,7 +80,6 @@ rec { libc = "glibc"; platform = platforms.fuloong2f_n32; openssl.system = "linux-generic32"; - inherit (platform) gcc; }; # diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 2d5353341f58..a4fa9af4e0a8 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -1,6 +1,7 @@ -with import ./parse.nix; -with import ../attrsets.nix; -with import ../lists.nix; +{ lib }: +with import ./parse.nix { inherit lib; }; +with lib.attrsets; +with lib.lists; rec { patterns = rec { diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 438d83685db4..d14ca04bfb9e 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -4,14 +4,13 @@ # http://llvm.org/docs/doxygen/html/Triple_8cpp_source.html especially # Triple::normalize. Parsing should essentially act as a more conservative # version of that last function. - -with import ../lists.nix; -with import ../types.nix; -with import ../attrsets.nix; -with (import ./inspect.nix).predicates; +{ lib }: +with lib.lists; +with lib.types; +with lib.attrsets; +with (import ./inspect.nix { inherit lib; }).predicates; let - lib = import ../default.nix; setTypesAssert = type: pred: mapAttrs (name: value: assert pred value; diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix index 54ed8f3c12c1..fd43ceaa0df2 100644 --- a/lib/systems/platforms.nix +++ b/lib/systems/platforms.nix @@ -1,7 +1,7 @@ +{ lib }: rec { pcBase = { name = "pc"; - uboot = null; kernelHeadersBaseConfig = "defconfig"; kernelBaseConfig = "defconfig"; # Build whatever possible as a module, if not stated in the extra config. @@ -49,9 +49,6 @@ rec { kernelTarget = "uImage"; # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working #kernelDTB = true; - - # XXX can be anything non-null, pkgs actually only cares if it is set or not - uboot = "pogoplug4"; }; sheevaplug = { @@ -161,9 +158,6 @@ rec { ''; kernelMakeFlags = [ "LOADADDR=0x0200000" ]; kernelTarget = "uImage"; - uboot = "sheevaplug"; - # Only for uboot = uboot : - ubootConfig = "sheevaplug_config"; kernelDTB = true; # Beyond 3.10 gcc = { arch = "armv5te"; @@ -250,7 +244,6 @@ rec { LATENCYTOP y ''; kernelTarget = "zImage"; - uboot = null; gcc = { arch = "armv6"; fpu = "vfp"; @@ -341,7 +334,6 @@ rec { XEN? n ''; kernelTarget = "zImage"; - uboot = null; }; scaleway-c1 = armv7l-hf-multiplatform // { @@ -373,7 +365,6 @@ rec { kernelMakeFlags = [ "LOADADDR=0x10800000" ]; kernelTarget = "uImage"; kernelDTB = true; - uboot = true; #XXX: any non-null value here is needed so that mkimage is present to build kernelTarget uImage gcc = { cpu = "cortex-a9"; fpu = "neon"; @@ -463,7 +454,6 @@ rec { FTRACE n ''; kernelTarget = "vmlinux"; - uboot = null; gcc = { arch = "loongson2f"; abi = "n32"; @@ -472,11 +462,10 @@ rec { beaglebone = armv7l-hf-multiplatform // { name = "beaglebone"; - kernelBaseConfig = "omap2plus_defconfig"; + kernelBaseConfig = "bb.org_defconfig"; kernelAutoModules = false; kernelExtraConfig = ""; # TBD kernel config kernelTarget = "zImage"; - uboot = null; }; armv7l-hf-multiplatform = { @@ -488,7 +477,6 @@ rec { kernelDTB = true; kernelAutoModules = true; kernelPreferBuiltin = true; - uboot = null; kernelTarget = "zImage"; kernelExtraConfig = '' # Fix broken sunxi-sid nvmem driver. @@ -544,11 +532,13 @@ rec { # Cavium ThunderX stuff. PCI_HOST_THUNDER_ECAM y + # Nvidia Tegra stuff. + PCI_TEGRA y + # The default (=y) forces us to have the XHCI firmware available in initrd, # which our initrd builder can't currently do easily. USB_XHCI_TEGRA m ''; - uboot = null; kernelTarget = "Image"; gcc = { arch = "armv8-a"; diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index 4c4c06fe78da..1657ec33a46c 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -201,7 +201,7 @@ runTests { # in alphabetical order testMkKeyValueDefault = { - expr = generators.mkKeyValueDefault ":" "f:oo" "bar"; + expr = generators.mkKeyValueDefault {} ":" "f:oo" "bar"; expected = ''f\:oo:bar''; }; diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index ba0c67fb7d42..96a91c0fffbc 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -61,6 +61,16 @@ checkConfigError() { checkConfigOutput "false" config.enable ./declare-enable.nix checkConfigError 'The option .* defined in .* does not exist.' config.enable ./define-enable.nix +# Check integer types. +# unsigned +checkConfigOutput "42" config.value ./declare-int-unsigned-value.nix ./define-value-int-positive.nix +checkConfigError 'The option value .* in .* is not of type.*unsigned integer.*' config.value ./declare-int-unsigned-value.nix ./define-value-int-negative.nix +# positive +checkConfigError 'The option value .* in .* is not of type.*positive integer.*' config.value ./declare-int-positive-value.nix ./define-value-int-zero.nix +# between +checkConfigOutput "42" config.value ./declare-int-between-value.nix ./define-value-int-positive.nix +checkConfigError 'The option value .* in .* is not of type.*between.*-21 and 43.*inclusive.*' config.value ./declare-int-between-value.nix ./define-value-int-negative.nix + # Check mkForce without submodules. set -- config.enable ./declare-enable.nix ./define-enable.nix checkConfigOutput "true" "$@" @@ -126,7 +136,7 @@ checkConfigOutput "true" "$@" ./define-module-check.nix # Check coerced value. checkConfigOutput "\"42\"" config.value ./declare-coerced-value.nix checkConfigOutput "\"24\"" config.value ./declare-coerced-value.nix ./define-value-string.nix -checkConfigError 'The option value .* in .* is not a string or integer.' config.value ./declare-coerced-value.nix ./define-value-list.nix +checkConfigError 'The option value .* in .* is not.*string or signed integer.*' config.value ./declare-coerced-value.nix ./define-value-list.nix cat <<EOF ====== module tests ====== diff --git a/lib/tests/modules/declare-int-between-value.nix b/lib/tests/modules/declare-int-between-value.nix new file mode 100644 index 000000000000..8b2624cc5d65 --- /dev/null +++ b/lib/tests/modules/declare-int-between-value.nix @@ -0,0 +1,9 @@ +{ lib, ... }: + +{ + options = { + value = lib.mkOption { + type = lib.types.ints.between (-21) 43; + }; + }; +} diff --git a/lib/tests/modules/declare-int-positive-value.nix b/lib/tests/modules/declare-int-positive-value.nix new file mode 100644 index 000000000000..6e48c6ac8feb --- /dev/null +++ b/lib/tests/modules/declare-int-positive-value.nix @@ -0,0 +1,9 @@ +{ lib, ... }: + +{ + options = { + value = lib.mkOption { + type = lib.types.ints.positive; + }; + }; +} diff --git a/lib/tests/modules/declare-int-unsigned-value.nix b/lib/tests/modules/declare-int-unsigned-value.nix new file mode 100644 index 000000000000..05d0eff01c94 --- /dev/null +++ b/lib/tests/modules/declare-int-unsigned-value.nix @@ -0,0 +1,9 @@ +{ lib, ... }: + +{ + options = { + value = lib.mkOption { + type = lib.types.ints.unsigned; + }; + }; +} diff --git a/lib/tests/modules/define-value-int-negative.nix b/lib/tests/modules/define-value-int-negative.nix new file mode 100644 index 000000000000..a041222987ad --- /dev/null +++ b/lib/tests/modules/define-value-int-negative.nix @@ -0,0 +1,3 @@ +{ + value = -23; +} diff --git a/lib/tests/modules/define-value-int-positive.nix b/lib/tests/modules/define-value-int-positive.nix new file mode 100644 index 000000000000..5803de172636 --- /dev/null +++ b/lib/tests/modules/define-value-int-positive.nix @@ -0,0 +1,3 @@ +{ + value = 42; +} diff --git a/lib/tests/modules/define-value-int-zero.nix b/lib/tests/modules/define-value-int-zero.nix new file mode 100644 index 000000000000..68bb9f415c3c --- /dev/null +++ b/lib/tests/modules/define-value-int-zero.nix @@ -0,0 +1,3 @@ +{ + value = 0; +} diff --git a/lib/trivial.nix b/lib/trivial.nix index a57cf30d171c..c452c7b65bc1 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -1,3 +1,4 @@ +{ lib }: rec { /* The identity function @@ -55,7 +56,7 @@ rec { isInt add sub lessThan seq deepSeq genericClosure; - inherit (import ./strings.nix) fileContents; + inherit (lib.strings) fileContents; # Return the Nixpkgs version number. nixpkgsVersion = diff --git a/lib/types.nix b/lib/types.nix index a7dcd3f1e1c7..88fc90d05970 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1,15 +1,16 @@ # Definitions related to run-time type checking. Used in particular # to type-check NixOS configurations. - -with import ./lists.nix; -with import ./attrsets.nix; -with import ./options.nix; -with import ./trivial.nix; -with import ./strings.nix; -let inherit (import ./modules.nix) mergeDefinitions filterOverrides; in - +{ lib }: +with lib.lists; +with lib.attrsets; +with lib.options; +with lib.trivial; +with lib.strings; +let + + inherit (lib.modules) mergeDefinitions filterOverrides; + outer_types = rec { - isType = type: x: (x._type or "") == type; setType = typeName: value: value // { @@ -95,7 +96,6 @@ rec { # When adding new types don't forget to document them in # nixos/doc/manual/development/option-types.xml! types = rec { - unspecified = mkOptionType { name = "unspecified"; }; @@ -108,11 +108,64 @@ rec { }; int = mkOptionType rec { - name = "int"; - description = "integer"; - check = isInt; - merge = mergeOneOption; - }; + name = "int"; + description = "signed integer"; + check = isInt; + merge = mergeOneOption; + }; + + # Specialized subdomains of int + ints = + let + betweenDesc = lowest: highest: + "${toString lowest} and ${toString highest} (both inclusive)"; + between = lowest: highest: assert lowest <= highest; + addCheck int (x: x >= lowest && x <= highest) // { + name = "intBetween"; + description = "integer between ${betweenDesc lowest highest}"; + }; + ign = lowest: highest: name: docStart: + between lowest highest // { + inherit name; + description = docStart + "; between ${betweenDesc lowest highest}"; + }; + unsign = bit: range: ign 0 (range - 1) + "unsignedInt${toString bit}" "${toString bit} bit unsigned integer"; + sign = bit: range: ign (0 - (range / 2)) (range / 2 - 1) + "signedInt${toString bit}" "${toString bit} bit signed integer"; + + in rec { + /* An int with a fixed range. + * + * Example: + * (ints.between 0 100).check (-1) + * => false + * (ints.between 0 100).check (101) + * => false + * (ints.between 0 0).check 0 + * => true + */ + inherit between; + + unsigned = addCheck types.int (x: x >= 0) // { + name = "unsignedInt"; + description = "unsigned integer, meaning >=0"; + }; + positive = addCheck types.int (x: x > 0) // { + name = "positiveInt"; + description = "positive integer, meaning >0"; + }; + u8 = unsign 8 256; + u16 = unsign 16 65536; + # the biggest int a 64-bit Nix accepts is 2^63 - 1 (9223372036854775808), for a 32-bit Nix it is 2^31 - 1 (2147483647) + # the smallest int a 64-bit Nix accepts is -2^63 (-9223372036854775807), for a 32-bit Nix it is -2^31 (-2147483648) + # u32 = unsign 32 4294967296; + # u64 = unsign 64 18446744073709551616; + + s8 = sign 8 256; + s16 = sign 16 65536; + # s32 = sign 32 4294967296; + }; str = mkOptionType { name = "str"; @@ -121,6 +174,13 @@ rec { merge = mergeOneOption; }; + strMatching = pattern: mkOptionType { + name = "strMatching ${escapeNixString pattern}"; + description = "string matching the pattern ${pattern}"; + check = x: str.check x && builtins.match pattern x != null; + inherit (str) merge; + }; + # Merge multiple definitions by concatenating them (with the given # separator between the values). separatedString = sep: mkOptionType rec { @@ -172,7 +232,7 @@ rec { }; # drop this in the future: - list = builtins.trace "`types.list' is deprecated; use `types.listOf' instead" types.listOf; + list = builtins.trace "`types.list` is deprecated; use `types.listOf` instead" types.listOf; listOf = elemType: mkOptionType rec { name = "listOf"; @@ -189,7 +249,7 @@ rec { ).optionalValue ) def.value else - throw "The option value `${showOption loc}' in `${def.file}' is not a list.") defs))); + throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs))); getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]); getSubModules = elemType.getSubModules; substSubModules = m: listOf (elemType.substSubModules m); @@ -240,25 +300,6 @@ rec { functor = (defaultFunctor name) // { wrapped = elemType; }; }; - # List or element of ... - loeOf = elemType: mkOptionType rec { - name = "loeOf"; - description = "element or list of ${elemType.description}s"; - check = x: isList x || elemType.check x; - merge = loc: defs: - let - defs' = filterOverrides defs; - res = (head defs').value; - in - if isList res then concatLists (getValues defs') - else if lessThan 1 (length defs') then - throw "The option `${showOption loc}' is defined multiple times, in ${showFiles (getFiles defs)}." - else if !isString res then - throw "The option `${showOption loc}' does not have a string value, in ${showFiles (getFiles defs)}." - else res; - functor = (defaultFunctor name) // { wrapped = elemType; }; - }; - # Value of given type but with no merging (i.e. `uniq list`s are not concatenated). uniq = elemType: mkOptionType rec { name = "uniq"; @@ -279,7 +320,7 @@ rec { let nrNulls = count (def: def.value == null) defs; in if nrNulls == length defs then null else if nrNulls != 0 then - throw "The option `${showOption loc}' is defined both null and not null, in ${showFiles (getFiles defs)}." + throw "The option `${showOption loc}` is defined both null and not null, in ${showFiles (getFiles defs)}." else elemType.merge loc defs; getSubOptions = elemType.getSubOptions; getSubModules = elemType.getSubModules; @@ -291,7 +332,7 @@ rec { submodule = opts: let opts' = toList opts; - inherit (import ./modules.nix) evalModules; + inherit (lib.modules) evalModules; in mkOptionType rec { name = "submodule"; @@ -307,8 +348,17 @@ rec { }).config; getSubOptions = prefix: (evalModules { modules = opts'; inherit prefix; - # FIXME: hack to get shit to evaluate. - args = { name = ""; }; }).options; + # This is a work-around due to the fact that some sub-modules, + # such as the one included in an attribute set, expects a "args" + # attribute to be given to the sub-module. As the option + # evaluation does not have any specific attribute name, we + # provide a default one for the documentation. + # + # This is mandatory as some option declaration might use the + # "name" attribute given as argument of the submodule and use it + # as the default of option declarations. + args.name = "<name>"; + }).options; getSubModules = opts'; substSubModules = m: submodule m; functor = (defaultFunctor name) // { @@ -395,5 +445,6 @@ rec { addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; }; }; +}; -} +in outer_types // outer_types.types |