about summary refs log tree commit diff
path: root/lib/options.nix
AgeCommit message (Collapse)AuthorFilesLines
2016-03-01Revert "Add the tool "nixos-typecheck" that can check an option declaration to:"Eelco Dolstra1-124/+21
This reverts commit cad8957eabcbf73062226d28366fd446c15c8737. It breaks NixOps, but more importantly, such major changes to the module system really need to be reviewed.
2016-02-29Add the tool "nixos-typecheck" that can check an option declaration to:Thomas Strobel1-21/+124
- 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.
2015-07-30Add read-only optionsEelco Dolstra1-0/+2
These are options that can have only one definition, regardless of priority.
2015-07-23Rename misc.nix -> deprecated.nixEelco Dolstra1-1/+0
2015-07-23Use foldl' instead of fold in some placesEelco Dolstra1-3/+3
2015-07-23optionAttrSetToDocList: O(n^2) -> O(n)Eelco Dolstra1-3/+2
This shaves about 10% off memory consumption of NixOS evaluation.
2015-06-15Make types.bool complain on conflicting definitionsEelco Dolstra1-0/+9
Previously, conflicting definitions would merge to "true". Now they give an error, e.g. error: The option `hardware.enableAllFirmware' has conflicting definitions, in `/etc/nixos/configurations/misc/eelco/stuff.nix' and `/etc/nixos/configurations/misc/eelco/mandark.nix'.
2015-06-15Remove obsolete stuffEelco Dolstra1-14/+0
2015-01-04Add Type information into manual and manpages, fixes #4600Domen Kožar1-0/+1
2014-12-21modules: Add mkSinkUndeclaredOptions.Nicolas B. Pierron1-0/+17
2014-10-05Eliminate some optionals/optionalAttrs calls on the hot pathEelco Dolstra1-3/+3
2013-11-12Add some primops to libEelco Dolstra1-5/+5
2013-10-30Clean up some option examplesEelco Dolstra1-1/+2
2013-10-30Strictly check the arguments to mkOptionEelco Dolstra1-11/+12
And fix various instances of bad arguments.
2013-10-30Show correct position info for errors in submodulesEelco Dolstra1-14/+17
E.g. The unique option `fileSystems./.device' is defined multiple times, in `/etc/nixos/configuration.nix' and `/etc/nixos/foo.nix'. This requires passing file/value tuples to the merge functions.
2013-10-28Remove obsolete function addDefaultOptionValuesEelco Dolstra1-26/+0
2013-10-28Show precise error messages in option merge failuresEelco Dolstra1-10/+11
For instance, if time.timeZone is defined multiple times, you now get the error message: error: user-thrown exception: The unique option `time.timeZone' is defined multiple times, in `/etc/nixos/configurations/misc/eelco/x11vnc.nix' and `/etc/nixos/configuration.nix'. while previously you got: error: user-thrown exception: Multiple definitions of string. Only one is allowed for this option. and only an inspection of the stack trace gave a clue as to what option caused the problem.
2013-10-28Remove uses of the "merge" option attributeEelco Dolstra1-0/+3
It's redundant because you can (and should) specify an option type, or an apply function.
2013-10-28Fix manual generationEelco Dolstra1-25/+23
2013-10-28Remove dead codeEelco Dolstra1-135/+0
2013-10-28Remove uses of mkFixStrictnessEelco Dolstra1-0/+1
mkFixStrictness is no longer needed, woohoo!
2013-10-28Big cleanup of the NixOS module systemEelco Dolstra1-42/+4
The major changes are: * The evaluation is now driven by the declared options. In particular, this fixes the long-standing problem with lack of laziness of disabled option definitions. Thus, a configuration like config = mkIf false { environment.systemPackages = throw "bla"; }; will now evaluate without throwing an error. This also improves performance since we're not evaluating unused option definitions. * The implementation of properties is greatly simplified. * There is a new type constructor "submodule" that replaces "optionSet". Unlike "optionSet", "submodule" gets its option declarations as an argument, making it more like "listOf" and other type constructors. A typical use is: foo = mkOption { type = type.attrsOf (type.submodule ( { config, ... }: { bar = mkOption { ... }; xyzzy = mkOption { ... }; })); }; Existing uses of "optionSet" are automatically mapped to "submodule". * Modules are now checked for unsupported attributes: you get an error if a module contains an attribute other than "config", "options" or "imports". * The new implementation is faster and uses much less memory.
2013-10-23Slightly improve option type error messagesEelco Dolstra1-6/+3
2013-10-23Manual: Don't show obsolete/deprecated optionsEelco Dolstra1-0/+1
2013-10-23Allow options to be marked as "internal"Eelco Dolstra1-0/+1
This means they're not for end users. Currently they're filtered from the manual, but we could include them in a separate section.
2013-10-17mkEnableOption: Add a period at the end of the descriptionEelco Dolstra1-5/+3
2013-10-17Rename newOptionAttrSetToDocList -> optionAttrSetToDocListEelco Dolstra1-3/+2
2013-10-10Move pkgs/lib/ to lib/Eelco Dolstra1-0/+315