summaryrefslogtreecommitdiff
path: root/lib/modules.nix (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib: introduce imap0, imap1 (#25543)•••* lib: introduce imap0, imap1 For historical reasons, imap starts counting at 1 and it's not consistent with the rest of the lib. So for now we split imap into imap0 that starts counting at zero and imap1 that starts counting at 1. And imap is marked as deprecated. See https://github.com/NixOS/nixpkgs/commit/c71e2d42359f9900ea2c290d141c0d606471da16#commitcomment-21873221 * replace uses of lib.imap * lib: move imap to deprecated.nix zimbatm2017-07-041-1/+1
* lib: trivial spelling fixesTom Saeger2017-04-191-1/+1
* lib: fix mixed tab/space indents, trailing whitespace, etc•••Nix style seems to have settled on not using spaces between bound variable names and the lambda : so I also tried to make those somewhat more consistent throughout. Benjamin Staffin2017-03-111-4/+4
* modules: add support for module replacement with disabledModules•••This is based on a prototype Nicolas B. Pierron worked on during a discussion we had at FOSDEM. A new version with a workaround for problems of the reverted original. Discussion: https://github.com/NixOS/nixpkgs/commit/3f2566689 Daiderd Jordan2017-03-031-7/+17
* Revert "modules: add support for module replacement with disabledModules"•••This reverts commit 3f2566689d14f1d7778d55ca807d1dad2f4695d1 for now. Evaluation of the tested job got broken, blocking nixos-unstable. Vladimír Čunát2017-03-011-17/+7
* modules: add support for module replacement with disabledModules•••This is based on a prototype Nicolas B. Pierron worked on during a discussion we had at FOSDEM. Daiderd Jordan2017-02-281-7/+17
* modules lib: type description in type error messageNikolay Amiantov2017-02-031-1/+1
* mkIf: Check whether the condition is a Boolean•••This gives a nicer error message than (say) while evaluating the option `fileSystems': while evaluating the attribute ‘isDefined’ at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:323:5: while evaluating ‘filterOverrides’ at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:395:21, called from /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:307:18: while evaluating ‘concatMap’ at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/lists.nix:79:18, called from /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:401:8: while evaluating ‘concatMap’ at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/lists.nix:79:18, called from /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:302:17: while evaluating anonymous function at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:302:28, called from undefined position: while evaluating ‘dischargeProperties’ at /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:365:25, called from /nix/store/r8z4vvl2qzg31zm4ra6awlx5b22k7gf9-nixos-16.09.tar.gz/lib/modules.nix:303:62: value is a list while a Boolean was expected Eelco Dolstra2016-11-211-3/+6
* module system: extensible option typesEric Sagnes2016-11-061-11/+21
* lib/module: add mkChangedOptionModule functionEric Sagnes2016-09-241-0/+26
* lib/module: add mkMergedOptionModule functionEric Sagnes2016-09-241-0/+53
* Merge pull request #15025 from ericsagnes/modules/manual•••manual: automatically generate modules documentationDomen Kožar2016-08-281-3/+7
|\
| * modules: move meta at top levelEric Sagnes2016-08-111-3/+7
* | Merge pull request #14311 from Profpatsch/mkRemovedOptionModule-replacement•••mkRemovedOptionModule: add replacement argumentDomen Kožar2016-08-281-4/+10
|\ \ | |/ |/|
| * modules/mkRemovedOptionModule: add replacement doc•••When displaying a warning about a removed Option we should always include reasoning why it was removed and how to get the same functionality without it. Introduces such a description argument and patches occurences (mostly with an empty string). startGnuPGAgent: further notes on replacement Profpatsch2016-05-291-4/+10
* | Fix display of deprecated option definition warnings•••Looks like this was accidentally left commented out by 5f077e229625583072ebf63ea48b11170771b0ed. Eelco Dolstra2016-06-011-2/+0
|/
* Revert "Add the tool "nixos-typecheck" that can check an option declaration to:"•••This reverts commit cad8957eabcbf73062226d28366fd446c15c8737. It breaks NixOps, but more importantly, such major changes to the module system really need to be reviewed. Eelco Dolstra2016-03-011-82/+17
* Add the tool "nixos-typecheck" that can check an option declaration to:••• - Enforce that an option declaration has a "defaultText" if and only if the type of the option derives from "package", "packageSet" or "nixpkgsConfig" and if a "default" attribute is defined. - Enforce that the value of the "example" attribute is wrapped with "literalExample" if the type of the option derives from "package", "packageSet" or "nixpkgsConfig". - Warn if a "defaultText" is defined in an option declaration if the type of the option does not derive from "package", "packageSet" or "nixpkgsConfig". - Warn if no "type" is defined in an option declaration. Thomas Strobel2016-02-291-17/+82
* Factor out option renaming•••Option aliases/deprecations can now be declared in any NixOS module, not just in nixos/modules/rename.nix. This is more modular (since it allows for example grub-related aliases to be declared in the grub module), and allows aliases outside of NixOS (e.g. in NixOps modules). The syntax is a bit funky. Ideally we'd have something like: options = { foo.bar.newOption = mkOption { ... }; foo.bar.oldOption = mkAliasOption [ "foo" "bar" "newOption" ]; }; but that's not possible because options cannot define values in *other* options - you need to have a "config" for that. So instead we have functions that return a *module*: mkRemovedOptionModule, mkRenamedOptionModule and mkAliasOptionModule. These can be used via "imports", e.g. imports = [ (mkAliasOptionModule [ "foo" "bar" "oldOption" ] [ "foo" "bar" "newOption" ]); ]; As an added bonus, deprecation warnings now show the file name of the offending module. Fixes #10385. Eelco Dolstra2015-10-141-0/+65
* Update option-usages.nix expression to work with newer version of the module ...Nicolas B. Pierron2015-08-091-1/+1
* Module system: Fix ‘definitions’ field•••Fixes https://github.com/NixOS/nixops/issues/325. Eelco Dolstra2015-08-051-1/+1
* Add read-only options•••These are options that can have only one definition, regardless of priority. Eelco Dolstra2015-07-301-3/+8
* Remove superfluous copy of "min"Eelco Dolstra2015-07-281-1/+0
* Minor module system evaluation speedups•••This gives about a 5% speedup. Issue #8152. Eelco Dolstra2015-07-281-22/+25
* Fix indentationEelco Dolstra2015-07-281-28/+29
* concatLists (map ...) -> concatMapEelco Dolstra2015-07-231-4/+4
* Use foldl' instead of fold in some placesEelco Dolstra2015-07-231-7/+7
* NixOS modules: Add error context on module arguments evaluation.Nicolas B. Pierron2015-07-141-5/+14
* types.uniq types.bool -> types.boolEelco Dolstra2015-06-151-1/+1
* Bring an importable modulesPath back from the dead, in the only way I knowDan Peebles2015-06-081-2/+6
* Document and rename internal option of modules.Nicolas B. Pierron2015-03-151-17/+17
* Share common code for merging option definitions.•••This move idioms which were used in `evalOptionValue` and in the `merge` functions of `listOf` and `attrsOf` types, such that we can use a names such as `isDefined` and `optionalValue` instead or repeating identical comparisons of `defsFinal == []`. Nicolas B. Pierron2015-03-121-7/+11
* Rename mergeDefinitions internal steps to functions which are independent of ...Nicolas B. Pierron2015-03-121-7/+8
* Expose submodule arguments to builtins.functionArgs before applying the argum...•••The current implementation of the ApplyIfFunction is looking at the arguments of a module to decide which arguments should be given to each module. This patch make sure that we do not wrap a submodule function in order to keep functionArgs working as expected. Nicolas B. Pierron2015-03-121-7/+27
* Add comment about limitation on __internal.checkShea Levy2015-03-121-0/+4
* Add comments about the module system interface•••Ideally the module system could be configured pretty much completely by the contents of the modules themselves, so add comments about avoiding complicating it further and possibly removing now-redundant configurability from the existing interface. Shea Levy2015-03-121-2/+14
* evalModules: Add internal option for the check argumentShea Levy2015-03-121-1/+11
* nixos: Don't evaluate twice to get the value of config.nixpkgsShea Levy2015-03-121-2/+2
* modules.nix: Generate the extra argument set from the configuration•••This allows for module arguments to be handled modularly, in particular allowing the nixpkgs module to handle the nixpkgs import internally. This creates the __internal option namespace, which should only be added to by the module system itself. Shea Levy2015-03-121-3/+30
* Move property processing, type checking, and merge code into a function•••This makes the relationship between property types clearer, and more importantly will let option types parameterized by other option types reuse the code for delegated type checking and merging. Shea Levy2015-03-121-22/+36
* modules: Extract mkAliasDefinition from the rename.nix NixOS module.Nicolas B. Pierron2014-12-221-0/+25
* nixos: Try to show an helpful message when the user sets config. or options.•••Feel free to improve or remove :-) Luca Bruno2014-11-011-1/+1
* Replace hasAttr/getAttr calls with the ? and . operators•••For NixOS evaluation, this gives a ~21% reduction in the number of values allocated and a ~4% speedup. It's also more readable. Eelco Dolstra2014-10-051-7/+7
* lib: Use arithmetic operators rather than builtins.add etc.Eelco Dolstra2014-10-051-1/+1
* Merge options having the submodule type.•••Now we should be able to have multiple declaration of the same option as long as all declarations have the same type. If the type has a sub module, then it is merged with the submodules of other declarations, as done with option sets. In addition, the file of the option declaration is passed into the submodule, such as the documentation can display it correctly. Nicolas Pierron2014-09-071-6/+15
* Annotate option-set options with the file in which they are declared.•••This modification improves NixOS manual by listing in which file, each submodule option is declared. This solve the issue that files are not reported when looking at options such as fileSystems.<name?>.neededForBoot Nicolas Pierron2014-09-071-8/+23
* Add error an message to prevent use of useless submodules.Nicolas Pierron2014-08-291-2/+3
* minor fix in documentation•••Signed-off-by: Domen Kožar <domen@dev.si> Jan Malakhovski2014-06-261-1/+1
* Re-introduce (marked as obsolete) mkStrict function, to allow old nixops depl...Rob Vermaas2014-05-051-0/+2
* Bring back mkOrderEelco Dolstra2014-03-301-5/+29