about summary refs log tree commit diff
path: root/lib/types.nix
AgeCommit message (Collapse)AuthorFilesLines
2024-04-09Merge pull request #284551 from hercules-ci/types-attrTagSilvan Mosberger1-1/+101
Add `types.attrTag`
2024-04-04doc: migrate trivial files to doc-comment format (#299986)Johannes Kirschbauer1-9/+18
* doc: migrate trivial files to doc-comment format * fix: revert some comments * Apply suggestions from code review Thanks @danielSidhion Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com> * Update lib/types.nix --------- Co-authored-by: Daniel Sidhion <DanielSidhion@users.noreply.github.com> Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-04-04types.attrTag: Remove unnecessary definitions override Robert Hensing1-1/+0
Committing because tests pass. Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-04-04lib.types.attrTag: Fix declarationPositions after mergeRobert Hensing1-1/+1
2024-04-04types.attrTag: Remove substSubmodulesRobert Hensing1-9/+0
I haven't managed to trigger the error, and it turns out that this method is optional. Specifically, getSubmodules is unimplemented (and unimplementable), the tests pass, and we seem to have good location info.
2024-04-04types.attrTagWith: removeRobert Hensing1-10/+18
Keep it simple for now.
2024-04-04lib.types.attrTag: Custom error when passing bare typeRobert Hensing1-1/+8
2024-04-04lib.types.attrTag: Remove tags from descriptionRobert Hensing1-1/+2
You can find them in the sub-options now.
2024-04-04lib.types.attrTag: Provide declarations, definitionsRobert Hensing1-2/+19
2024-04-04lib/types.nix: Fix getSubOptions docRobert Hensing1-1/+1
This comment was added in 73f32d03758a5, when it was already supposed to be an attrset.
2024-04-04lib.types.attrTag: Support type mergingRobert Hensing1-1/+22
2024-04-04lib.types.attrTag: Take options instead of typesRobert Hensing1-6/+21
2024-04-04lib.types.attrTag: Support module docsRobert Hensing1-1/+5
2024-02-11lib.types.attrTag: initRobert Hensing1-0/+37
2024-02-10Merge pull request #284512 from hercules-ci/lib-types-unique-mergeSilvan Mosberger1-13/+2
lib.types.unique: Check inner type deeply
2024-02-04lib.types.uniq: Check inner typeRobert Hensing1-12/+1
We now reuse the `unique` type, which implements this. Keeping the duplication around would be bad at this point.
2024-01-29types.nix: fix nonEmptyListOfDanila Danko1-0/+1
2024-01-28lib.types.unique: Check inner type deeplyRobert Hensing1-1/+1
This doesn't change uniq. Why not? - In NixOS it seems that uniq is only used with simple types that are fully checked by t.check. - It exists for much longer and is used more widely. - I believe we should deprecate it, because unique was already better. - unique can be a proving ground.
2023-12-23lib.types: Improve descriptions of composed types that have commasRobert Hensing1-3/+19
Type: either ints.positive (enum ["auto"]) Before: positive integer, meaning >0 or value "auto" (singular enum) After: positive integer, meaning >0, or value "auto" (singular enum)
2023-12-15treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobsAdam Joseph1-0/+1
2023-12-08lib.types.boolByOr: initSilvan Mosberger1-0/+16
This type is necessary to have correct merging behavior for `allowUnfreePredicate` and `allowInsecurePredicate` Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-08-10lib.types.string: Use lib.warn instead of deprecationMessageSilvan Mosberger1-4/+6
This will cause a poorer error message without option location information, but it will catch all uses of its use.
2023-08-10Revert "lib.types.string: Deprecation error instead of warning"Silvan Mosberger1-1/+4
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.
2023-08-08lib.types.string: Deprecation error instead of warningSilvan Mosberger1-4/+1
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.
2023-06-27lib/types: add pathInStoreNaïm Favier1-0/+9
2023-06-23lib/types: remove unused recfigsoda1-1/+1
2023-05-17lib.types.submoduleWith: Interoperate with older version of submoduleWithRobert Hensing1-3/+5
2023-05-10lib.types.pkgs: initRobert Hensing1-0/+8
A nominal type.
2023-05-06lib/modules: Move class out of specialArgsRobert Hensing1-2/+8
2022-12-31lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing1-3/+3
2022-12-31lib.types.path: Do not allow lists of stringsRobert Hensing1-2/+1
2022-12-31treewide: isCoercibleToString -> isMoreCoercibleToStringRobert Hensing1-2/+2
No change in behavior.
2022-12-31lib.types.anything: Use isSimpleCoercibleToStringRobert Hensing1-1/+2
Expecting no change in behavior.
2022-12-29lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing1-1/+1
2022-12-29Revert "lib/types: remove loaOf"Robert Hensing1-0/+9
This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users.
2022-12-19lib/types: remove loaOfSandro Jäckel1-9/+0
2022-11-08lib/types: add `descriptionClass` for `path`Naïm Favier1-0/+1
2022-10-18Merge pull request #194035 from Ma27/show-option-quotingRobert Hensing1-2/+2
lib/options/showOption: fix quoting of attr-names that are not identifiers
2022-10-13Merge pull request #192755 from hercules-ci/lib-types-unspecified-nameSilvan Mosberger1-1/+2
2022-10-07lib/types: always use `<function body>` instead of `[function body]` to ↵Maximilian Bosch1-2/+2
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.
2022-09-26lib/types.nix: remove unused bindingsfigsoda1-2/+0
2022-09-25lib/types.nix: Document that it should not be usedpiegames1-2/+16
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-09-24lib.types.unspecified: Make name match attribute name againRobert Hensing1-1/+2
@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
2022-09-17lib.types: Add parentheses where description is ambiguousRobert Hensing1-13/+69
2022-09-09Merge pull request #181834 from ncfavier/numbersSilvan Mosberger1-9/+33
lib/types: add `number`
2022-07-24lib/types: add `number`Naïm Favier1-9/+33
For numbers that can be ints or floats.
2022-06-25lib.types, nixos/users: Make passwdEntry availableKlemens Nanni1-0/+6
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.
2022-06-14lib.deferredModule: Make it properly singularRobert Hensing1-1/+3
2022-06-14lib.types: Add deferredModuleWithRobert Hensing1-2/+22
2022-06-14lib.types.deferredModule: Allow path-typed module referencesRobert Hensing1-1/+1