summaryrefslogtreecommitdiff
path: root/lib/types.nix (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib.types.string: Use lib.warn instead of deprecationMessage•••This will cause a poorer error message without option location information, but it will catch all uses of its use. Silvan Mosberger2023-08-101-4/+6
* Revert "lib.types.string: Deprecation error instead of warning"•••This reverts commit c59c6b1c57da542b6b4af5d2ac27d1b99e7f0c5e. This was a bit too ambitious, because no warnings were previously triggered when `string` was nested e.g. `attrsOf string`, `nullOr string`, etc. Support for nested type deprecation warnings was introduced in 4b54aedee5e05aaf2838f6d951508b83e33d2baa, but had to be reverted in a36e6760e9be0ec260b637a06d751d39e2a78e4e because it caused infinite recursion for some users, and I couldn't remember that it was reverted. Silvan Mosberger2023-08-101-1/+4
* lib.types.string: Deprecation error instead of warning•••The type has given a warning on use since [4 years ago](03392cd336b128a1639c648baf0f6c1a1271e0d2), I think it's safe to move the deprecation to the next stage: An error instead of a warning. Silvan Mosberger2023-08-081-4/+1
* lib/types: add pathInStoreNaïm Favier2023-06-271-0/+9
* lib/types: remove unused recfigsoda2023-06-231-1/+1
* lib.types.submoduleWith: Interoperate with older version of submoduleWithRobert Hensing2023-05-171-3/+5
* lib.types.pkgs: init•••A nominal type. Robert Hensing2023-05-101-0/+8
* lib/modules: Move class out of specialArgsRobert Hensing2023-05-061-2/+8
* lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing2022-12-311-3/+3
* lib.types.path: Do not allow lists of stringsRobert Hensing2022-12-311-2/+1
* treewide: isCoercibleToString -> isMoreCoercibleToString•••No change in behavior. Robert Hensing2022-12-311-2/+2
* lib.types.anything: Use isSimpleCoercibleToString•••Expecting no change in behavior. Robert Hensing2022-12-311-1/+2
* lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing2022-12-291-1/+1
* Revert "lib/types: remove loaOf"•••This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users. Robert Hensing2022-12-291-0/+9
* lib/types: remove loaOfSandro Jäckel2022-12-191-9/+0
* lib/types: add `descriptionClass` for `path`Naïm Favier2022-11-081-0/+1
* Merge pull request #194035 from Ma27/show-option-quoting•••lib/options/showOption: fix quoting of attr-names that are not identifiersRobert Hensing2022-10-181-2/+2
|\
| * lib/types: always use `<function body>` instead of `[function body]` to indic...•••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. Maximilian Bosch2022-10-071-2/+2
* | Merge pull request #192755 from hercules-ci/lib-types-unspecified-nameSilvan Mosberger2022-10-131-1/+2
|\ \ | |/ |/|
| * lib.types.unspecified: Make name match attribute name again•••@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 Robert Hensing2022-09-241-1/+2
* | lib/types.nix: remove unused bindingsfigsoda2022-09-261-2/+0
* | lib/types.nix: Document that it should not be used•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> piegames2022-09-251-2/+16
|/
* lib.types: Add parentheses where description is ambiguousRobert Hensing2022-09-171-13/+69
* Merge pull request #181834 from ncfavier/numbers•••lib/types: add `number`Silvan Mosberger2022-09-091-9/+33
|\
| * lib/types: add `number`•••For numbers that can be ints or floats. Naïm Favier2022-07-241-9/+33
* | lib.types, nixos/users: Make passwdEntry available•••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. Klemens Nanni2022-06-251-0/+6
|/
* lib.deferredModule: Make it properly singularRobert Hensing2022-06-141-1/+3
* lib.types: Add deferredModuleWithRobert Hensing2022-06-141-2/+22
* lib.types.deferredModule: Allow path-typed module referencesRobert Hensing2022-06-141-1/+1
* lib.types.deferredModule: Improve reported locationRobert Hensing2022-06-141-1/+1
* lib.types: Add deferredModuleRobert Hensing2022-06-141-0/+8
* lib/types, lib/modules: Remove unused extensionOffsetRobert Hensing2022-06-141-6/+0
* lib/types: Use map instead of imap1 in submoduleWithRobert Hensing2022-06-141-1/+1
* lib/types: Simplify submoduleWith shorthandOnlyDefinesConfig handling•••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 Silvan Mosberger2022-06-141-12/+3
* Merge pull request #173621 from ncfavier/submodule-description•••lib/types: allow custom `submoduleWith` descriptionsRobert Hensing2022-06-101-6/+17
|\
| * lib/types: allow custom `submoduleWith` descriptions•••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`. Naïm Favier2022-05-191-6/+17
* | Merge pull request #172813 from hercules-ci/functionTo-properly•••`lib.types.functionTo` type merging and docsRobert Hensing2022-05-171-1/+3
|\ \
| * | lib.types.functionTo: Add pseudo-attr to generated docsRobert Hensing2022-05-131-1/+1
| * | lib.types.functionTo: Support type mergingRobert Hensing2022-05-131-0/+2
| |/
* / lib/types: Drop misleading plural from type descriptions #170561•••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. Klemens Nanni2022-04-271-3/+3
|/
* lib.types.submoduleWith: Avoid _key collisions after extendModulesRobert Hensing2022-04-241-2/+8
* lib/modules: Finally remove deprecated types.optionSet•••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 :) Silvan Mosberger2022-03-181-8/+0
* Merge pull request #156533 from hercules-ci/issue-146882-transparent-submodul...•••lib.modules: Let module declare options directly in bare submoduleSilvan Mosberger2022-03-161-7/+15
|\
| * lib.modules: Inline a private function•••This should save about four calls per module. Robert Hensing2022-03-031-7/+7
| * lib.modules: Default shorthandOnlyDefinesConfig to true when nullRobert Hensing2022-03-031-1/+5
| * lib.modules: Make option injection work when shorthandOnlyDefinesConfigRobert Hensing2022-03-031-1/+5
| * lib.types.submodule: Remove redundant isSubmodule attrRobert Hensing2022-03-031-5/+0
| * lib.modules: Let module declare options directly in bare submodule•••... 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 Robert Hensing2022-03-031-0/+5
* | Merge pull request #163443 from ncfavier/fix-types-package•••lib.types.package: only call toDerivation when necessaryRobert Hensing2022-03-111-2/+10
|\ \
| * | lib.types.package: only call toDerivation when necessary•••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. Naïm Favier2022-03-111-2/+10
| |/