summary refs log tree commit diff
path: root/lib/types.nix
Commit message (Collapse)AuthorAge
* Replace short URL from #63103 with full URL.Drew Hess2020-01-15
| | | | | The error message is already helpfully verbose, so there's little reason to shorten the informational URL.
* lib/types: prioritise coercedType in coercedToarcnmx2020-01-14
| | | | | This more intuitively matches `types.either` and allows paths to be coerced to submodules again, which was inhibited by #76861
* lib/types: dont warn loaOf for home-manager namespaceworldofpeace2020-01-12
| | | | | This option namespace is not a part of NixOS so we shouldn't provide this warning for it.
* Merge pull request #77501 from jtojnar/more-loaof-fxesJan Tojnar2020-01-12
|\ | | | | tree-wide: fix more warning related to loaOf deprecation
| * lib/types: improve loaOf message even moreJan Tojnar2020-01-11
| | | | | | | | Now we suggest correct names for all options in Nixpkgs and also home-manager at the time of writing.
| * lib/types: only show ... in loaOf warning when necessaryJan Tojnar2020-01-11
| |
| * lib/types: improve loaOf warningJan Tojnar2020-01-11
| | | | | | | | | | Not all modules use name attribute as the name of the submodule, for example, environment.etc uses target. We will need to maintain a list of exceptions.
* | Merge pull request #76861 from Infinisil/paths-as-submodulesRobert Hensing2020-01-12
|\ \ | |/ |/| lib/types: Allow paths as submodule values
| * lib/types: Allow paths as submodule valuesSilvan Mosberger2020-01-08
| |
* | lib/types: Introduce lazyAttrsOfSilvan Mosberger2020-01-10
| | | | | | | | | | | | | | The standard attrsOf is strict in its *values*, meaning it's impossible to access only one attribute value without evaluating all others as well. lazyAttrsOf is a version that doesn't have that problem, at the expense of conditional definitions not properly working anymore.
* | lib/types: Add emptyValue attribute to typesSilvan Mosberger2020-01-10
|/ | | | Co-Authored-By: Robert Hensing <roberth@users.noreply.github.com>
* Merge pull request #77133 from Infinisil/fix-path-checkSilvan Mosberger2020-01-07
|\ | | | | lib/types: Fix path type check
| * lib/types: Fix path type checkSilvan Mosberger2020-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when this function was called without a value coercible to a string it would throw an error instead of returning false. Now it does. As a result this now allows the use of a type like `either path attrs` without it erroring out when a definition is an attribute set. The warning about there not being a isPath primop was removed because this is not the case anymore, there is builtins.isPath. But also there always was `builtins.typeOf x == "path"` that could've been used instead. However the path type now stands for more than just path types, but absolute paths in general.
* | lib/types: warn loaOf is deprecatedrnhmjoj2020-01-06
|/
* Revert "lib/types: Allow paths as submodule values"Silvan Mosberger2020-01-03
| | | | | | | | | This reverts commit eec83d41e3e7d9ad5bc1086198d972d55bab1203. This broke hydra evaluation because with this commit submodule values are allowed to be paths, however the certmgr module uses `either (submodule ...) path` in its type, meaning it already used paths for something else which would now be interpreted as a submodule.
* lib/types: Allow paths as submodule valuesSilvan Mosberger2020-01-02
|
* lib/types: Add types.submoduleWith for more flexibility than types.submoduleSilvan Mosberger2020-01-01
|
* Merge branch 'master' into stagingVladimír Čunát2019-09-02
|\
| * lib/types: Make usage of types.string emit a warningSilvan Mosberger2019-08-31
| |
* | treewide: remove redundant recvolth2019-08-28
| |
* | treewide: remove redundant quotesvolth2019-08-26
|/
* Merge pull request #65728 from Infinisil/types-eithersAaron Andersen2019-08-13
|\ | | | | lib/types: Add oneOf, extension of either to a list of types
| * lib/types: Add oneOf, extension of either to a list of typesSilvan Mosberger2019-08-06
| |
* | lib/types: change merge strategy for `str`, `int`, `float` and `enum`danbst2019-07-25
|/ | | | Change to `mergeEqualOption`.
* module system: revert "remove types.optionSet", just deprecate (#56857)Danylo Hlynskyi2019-03-07
| | | | | | | | | | | | | | | | | | | | The explicit remove helped to uncover some hidden uses of `optionSet` in NixOps. However it makes life harder for end-users of NixOps - it will be impossible to deploy 19.03 systems with old NixOps, but there is no new release of NixOps with `optionSet` fixes. Also, "deprecation" process isn't well defined. Even that `optionSet` was declared "deprecated" for many years, it was never announced. Hence, I leave "deprecation" announce. Then, 3 releases after announce, we can announce removal of this feature. This type has to be removed, not `throw`-ed in runtime, because it makes some perfectly fine code to fail. For example: ``` $ nix-instantiate --eval -E '(import <nixpkgs/lib>).types' --strict trace: `types.list` is deprecated; use `types.listOf` instead error: types.optionSet is deprecated; use types.submodule instead (use '--show-trace' to show detailed location information) ```
* types.optionSet: deprecate and remove last usagesdanbst2019-01-31
|
* lib/types.nix: small eval optimization (listToAttrs + mapAttrsToList -> ↵danbst2019-01-30
| | | | mapAttrs)
* Add type port as an alias to u16Daniel Rutz2018-10-18
|
* lib/types: enhances separatedString's descriptionSamuel Dionne-Riel2018-10-12
| | | | | | | | | The previous description "string" is misleading in the full options manual pages; they are actually concatenated strings, with a specific character. The empty string version ("types.string") has been special-cased to provide a better message.
* lib: move assertMsg and assertOneOf to their own library fileProfpatsch2018-09-06
| | | | | Since the `assertOneOf` uses `lib.generators`, they are not really trivial anymore and should go into their own library file.
* lib/trivial: add a few examples of usage of assertMsg/assertOneOfProfpatsch2018-09-06
|
* [bot] treewide: remove unused 'inherit' in let blocksvolth2018-07-20
|
* [bot]: remove unreferenced codevolth2018-07-20
|
* lib: add float option typeRichard Marko2018-07-03
|
* doc: Fixes documented default option for `<name>` for submodules. (#40464)Samuel Dionne-Riel2018-05-16
| | | | | Fixes #40463 This is related to change 1d56d0c8a79334cd7149fd580512046558eaac78
* lib.types: fix loaOf behavior for long listsRobert Helgesson2018-05-07
| | | | | | | Assigning a list of 10 or more elements to an option having the type `loaOf a` produces a configuration value that is not honoring the order of the original list. This commit fixes this and a related issue arising when 10 or more lists are merged into this type of option.
* lib/types: remove unnecessary coerceFunc assertionSilvan Mosberger2018-05-06
|
* lib/types: clear up coercedTo descriptionSilvan Mosberger2018-05-06
|
* lib/types: Fix coercedTo checkSilvan Mosberger2018-05-06
| | | | | | | | | | | | Without this change (coercedTo str toInt int).check "foo" would evaluate to true, even though (coercedTo str toInt int).merge {} [{ value = "foo"; }] will throw an error because "foo" can't be coerced to an int.
* lib/types: add types.nonEmptyListOfRobert Schütz2018-02-08
|
* nixpkgs.lib: Add types.strMatchingRyan Trinkle2017-12-02
|
* lib/types.nix: Disable 32-bit integer types for nowTuomas Tynkkynen2017-11-05
| | | | | | | | | This file doesn't evaluate in 32-bit versions of Nix because the integer type is a signed 32-bit integer there, so 4294967296 causes an 'invalid integer' error. I see no other way around than commenting this out :( (s32 could be made to work by tweaking the expressions a bit, but didn't do that for now since it'd be asymmetric to have s32 but no u32).
* lib/types: fix up documentation formatting a bitProfpatsch2017-11-05
|
* lib/types: add `ints.positive`.Profpatsch2017-11-05
| | | | For values that are positive, but cannot be 0.
* lib/types: match lowercase descriptions of other typesProfpatsch2017-11-05
|
* lib/types: signed -> s, unsigned -> u, remove signed aliasProfpatsch2017-11-05
| | | | | | Mirrors the way it’s done in modern low-level languages like Rust (by input of @nbp). Removes the signed alias for int.
* lib/types: remove port type againProfpatsch2017-11-05
| | | | Will be introduced as a taggedUnion, once that type is in nixpkgs.
* lib/types: add port typeProfpatsch2017-11-05
|
* lib/types: add various signed/unsigned int typesProfpatsch2017-11-05
| | | | | It is sometimes necessary to restrict the domain of integers for configurations, as well as restricting them to unsigned/positive values.
* lib/types: add intBetweenProfpatsch2017-11-05
| | | | An int type that checks the value range.