summary refs log tree commit diff
path: root/lib/types.nix
Commit message (Collapse)AuthorAge
* lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing2022-12-31
|
* lib.types.path: Do not allow lists of stringsRobert Hensing2022-12-31
|
* treewide: isCoercibleToString -> isMoreCoercibleToStringRobert Hensing2022-12-31
| | | | No change in behavior.
* lib.types.anything: Use isSimpleCoercibleToStringRobert Hensing2022-12-31
| | | | Expecting no change in behavior.
* lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing2022-12-29
|
* Revert "lib/types: remove loaOf"Robert Hensing2022-12-29
| | | | | | | This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users.
* lib/types: remove loaOfSandro Jäckel2022-12-19
|
* lib/types: add `descriptionClass` for `path`Naïm Favier2022-11-08
|
* Merge pull request #194035 from Ma27/show-option-quotingRobert Hensing2022-10-18
|\ | | | | lib/options/showOption: fix quoting of attr-names that are not identifiers
| * lib/types: always use `<function body>` instead of `[function body]` to ↵Maximilian Bosch2022-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | indicate a function inside an option structure The motivation is to have a single identifier for that. Useful for the next commit where I'll try to escape option-parts correctly (options can be any kind of strings, but unless these are Nix identifiers, they must be quoted). Since `<function body>` (or `<name>`/`*`) are special identifiers in error messages and the manual, we need a unique way to mark an option part as function call because these are not to be quoted.
* | Merge pull request #192755 from hercules-ci/lib-types-unspecified-nameSilvan Mosberger2022-10-13
|\ \ | |/ |/|
| * lib.types.unspecified: Make name match attribute name againRobert Hensing2022-09-24
| | | | | | | | | | @Infinisil: This isn't right, the name shouldn't be changed, but instead a description should be added https://github.com/NixOS/nixpkgs/pull/191353#discussion_r978983401
* | lib/types.nix: remove unused bindingsfigsoda2022-09-26
| |
* | lib/types.nix: Document that it should not be usedpiegames2022-09-25
|/ | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
* lib.types: Add parentheses where description is ambiguousRobert Hensing2022-09-17
|
* Merge pull request #181834 from ncfavier/numbersSilvan Mosberger2022-09-09
|\ | | | | lib/types: add `number`
| * lib/types: add `number`Naïm Favier2022-07-24
| | | | | | | | For numbers that can be ints or floats.
* | lib.types, nixos/users: Make passwdEntry availableKlemens Nanni2022-06-25
|/ | | | | | | | More nixpkgs code such as `boot.initrd.systemd.emergencyAccess` defines options that takes hashed passwords, so move the type definition from modules/ into lib/. The type definition itself stays unchanged.
* lib.deferredModule: Make it properly singularRobert Hensing2022-06-14
|
* lib.types: Add deferredModuleWithRobert Hensing2022-06-14
|
* lib.types.deferredModule: Allow path-typed module referencesRobert Hensing2022-06-14
|
* lib.types.deferredModule: Improve reported locationRobert Hensing2022-06-14
|
* lib.types: Add deferredModuleRobert Hensing2022-06-14
|
* lib/types, lib/modules: Remove unused extensionOffsetRobert Hensing2022-06-14
|
* lib/types: Use map instead of imap1 in submoduleWithRobert Hensing2022-06-14
|
* lib/types: Simplify submoduleWith shorthandOnlyDefinesConfig handlingSilvan Mosberger2022-06-14
| | | | | The module system already uses the parent module's _file as a fallback, so we don't need to inject the file in a weird way
* Merge pull request #173621 from ncfavier/submodule-descriptionRobert Hensing2022-06-10
|\ | | | | lib/types: allow custom `submoduleWith` descriptions
| * lib/types: allow custom `submoduleWith` descriptionsNaïm Favier2022-05-19
| | | | | | | | | | | | | | | | Currently the only way to set the description for a submodule type is to use `freeformType`. This is not ideal as it requires setting a freeform type, and evaluates the submodule config unnecessarily. Instead, add a `description` argument to `submoduleWith`.
* | Merge pull request #172813 from hercules-ci/functionTo-properlyRobert Hensing2022-05-17
|\ \ | | | | | | `lib.types.functionTo` type merging and docs
| * | lib.types.functionTo: Add pseudo-attr to generated docsRobert Hensing2022-05-13
| | |
| * | lib.types.functionTo: Support type mergingRobert Hensing2022-05-13
| |/
* / lib/types: Drop misleading plural from type descriptions #170561Klemens Nanni2022-04-27
|/ | | | | | | | | | | | | | | | | | | | | Probably being the most prominent document demonstrating the problem, configuration.nix(5) describes various types in plural, e.g. - ` Type: list of strings` - ` Type: list of systemd options` However, there are other cases where appending "s" to the inner type effectively changes the type, e.g. - ``` Type: list of string matching the pattern [a-zA-Z0-9@%:_.\-]+[.](service|socket|device|mount|automount|swap|target|path|timer|scope|slice)s ``` This should've read "list of string[s]..." but instead changes the regular expression. Simply drop the best-effort plural in favour of correctness and simplicity rather than adding more grammar related logic/trying to fix this.
* lib.types.submoduleWith: Avoid _key collisions after extendModulesRobert Hensing2022-04-24
|
* lib/modules: Finally remove deprecated types.optionSetSilvan Mosberger2022-03-18
| | | | | | | | | | | types.optionSet has been deprecated for almost 10 years now (0e333688cea468a28516bf6935648c03ed62a7bb)! A removal was already attempted in 2019 (27982b408e465554b8831f492362bc87ed0ec02a), but it was promptly reinstantiated since some third-party uses were discovered (f531ce75e4178c6867cc1d0f7fec96b2d5c3f1cb). It's finally time to remove it for good :)
* Merge pull request #156533 from ↵Silvan Mosberger2022-03-16
|\ | | | | | | | | hercules-ci/issue-146882-transparent-submodule-options lib.modules: Let module declare options directly in bare submodule
| * lib.modules: Inline a private functionRobert Hensing2022-03-03
| | | | | | | | This should save about four calls per module.
| * lib.modules: Default shorthandOnlyDefinesConfig to true when nullRobert Hensing2022-03-03
| |
| * lib.modules: Make option injection work when shorthandOnlyDefinesConfigRobert Hensing2022-03-03
| |
| * lib.types.submodule: Remove redundant isSubmodule attrRobert Hensing2022-03-03
| |
| * lib.modules: Let module declare options directly in bare submoduleRobert Hensing2022-03-03
| | | | | | | | | | | | | | | | | | | | ... where a bare submodule is an option that has a type like `submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`. This makes migration unnecessary when introducing a freeform type in an existing option tree. Closes #146882
* | Merge pull request #163443 from ncfavier/fix-types-packageRobert Hensing2022-03-11
|\ \ | | | | | | lib.types.package: only call toDerivation when necessary
| * | lib.types.package: only call toDerivation when necessaryNaïm Favier2022-03-11
| |/ | | | | | | | | | | | | | | | | | | | | The current logic assumes that everything that isn't a derivation is a store path, but it can also be something that's *coercible* to a store path, like a flake input. Unnecessary uses of `lib.toDerivation` result in errors in pure evaluation mode when `builtins.storePath` is disabled. Also document what a `package` is.
* / lib.types.optionType: Only merge when necessaryRobert Hensing2022-03-10
|/
* Merge pull request #162283 from Infinisil/functionTo.descriptionSilvan Mosberger2022-03-02
|\ | | | | lib/types: Fix functionTo description
| * lib/types: Fix functionTo descriptionSilvan Mosberger2022-03-01
| |
* | lib.types: Introduce `types.optionType`Silvan Mosberger2022-03-01
|/ | | | | | This type correctly merges multiple option types together while also annotating them with file information. In a future commit this will be used for `_module.freeformType`
* lib/types: Introduce types.raw for unprocessed valuesSilvan Mosberger2022-02-22
|
* lib/types: Fix emptyValue of listOf and nonEmptyListOfSilvan Mosberger2022-02-17
| | | | | | An empty list is [], not {}! Also, non-empty lists shouldn't have a default of an empty list!
* lib.types: Add unique like uniq, but custom errorsRobert Hensing2022-01-24
| | | | | Couldn't extend types.uniq and it had a silly name anyway. Now we can have better error messages.
* types.singleLineStr: Improve descriptionJules Aguillon2022-01-21
| | | | Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>