summaryrefslogtreecommitdiff
path: root/lib/types.nix (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib/types: check paths in pathWith with hasStorePathPrefix (#387304)Johannes Kirschbauer2025-04-211-1/+8
|\
| * lib/types: check paths in pathWith with hasStorePathPrefix•••This permits usage of content‐addressed derivations and has the added benefit of checking normalised paths. Mikael Voss2025-04-021-1/+8
* | lib.types.submodule: Disable check during docs generation•••Put simply docs generation is a weird eval, and we should avoid generating any unnecessary errors. Robert Hensing2025-04-111-2/+29
|/
* treewide: Format all Nix files•••Format all Nix files using the officially approved formatter, making the CI check introduced in the previous commit succeed: nix-build ci -A fmt.check This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153) of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166). This commit will lead to merge conflicts for a number of PRs, up to an estimated ~1100 (~33%) among the PRs with activity in the past 2 months, but that should be lower than what it would be without the previous [partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537). Merge conflicts caused by this commit can now automatically be resolved while rebasing using the [auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase). If you run into any problems regarding any of this, please reach out to the [formatting team](https://nixos.org/community/teams/formatting/) by pinging @NixOS/nix-formatting. Silvan Mosberger2025-04-011-1037/+1278
* lib/types: types.either deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-201-3/+3
* lib/types: types deprecate functor.wrapped in favor of functor.payload.elemTy...Silvan Mosberger2025-03-201-7/+16
|\
| * lib/types: types.coercedTo deprecate functor.wrapped in favor of functor.payl...Johannes Kirschbauer2025-03-151-4/+7
| * lib/types: types.functionTo deprecate functor.wrapped in favor of functor.pay...Johannes Kirschbauer2025-03-151-1/+3
| * lib/types: types.nullOr deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-151-1/+3
| * lib/types: types.{unique,uniq} deprecate functor.wrapped in favor of functor....Johannes Kirschbauer2025-03-151-1/+3
* | lib.types: add `luaInline`•••Represents inline lua as expected by `lib.generators.toLua`, for embedding raw lua expressions within structurally generated lua. Matt Sturgeon2025-03-151-0/+9
|/
* lib.types.functionTo: preserve functionArgs•••Previously if function in defs had set pattern in argument, this information would be lost. This keeps functionArgs in set pattern, by using functor and `__functionArgs` that is later used by `lib.functionArgs`. Wroclaw2025-03-021-2/+7
* lib.types: Make functor.wrapped deprecation work in unprocessed types•••Otherwise nested types such as `attrsOf (attrsOf int)` won't have a backwards compatible `type.nestedTypes.elemType.functor.wrapped`. Follow-up work to https://github.com/NixOS/nixpkgs/pull/366015 Silvan Mosberger2025-02-191-2/+11
* lib/pathWith: keep old typename, to avoid breakage in downstream projectsJohannes Kirschbauer2025-02-191-2/+2
* lib/types: add `types.pathWith`•••This gives people some flexibility when they need a path type, and prevents a "combinatorial explosion" of various path stops. I've re-implemented our existing `path` and `pathInStore` types using `pathWith`. Our existing `package` type is potentially a candidate for similar treatment, but it's a little quirkier (there's some stuff with `builtins.hasContext` and `toDerivation` that I don't completely understand), and I didn't want to muddy this PR with that. As a happy side effect of this work, we get a new feature: the ability to create a type for paths *not* in the store. This is useful for when a module needs a path to a file, and wants to protect people from accidentally leaking that file into the nix store. Jeremy Fleischman2025-02-151-11/+38
* lib.types: init mergeTypes (#364620)Johannes Kirschbauer2025-02-101-0/+47
|\
| * lib.types: init mergeTypesJohannes Kirschbauer2025-02-101-0/+47
* | lib/types: deprecate functor.wrapped in types.listOfJohannes Kirschbauer2025-01-061-1/+3
* | lib/types: refactor elemTypeFunctor for types.attrsWithJohannes Kirschbauer2025-01-061-7/+23
|/
* lib/types: make pattern of strMatching accessible (#350467)Silvan Mosberger2024-12-091-0/+5
|\
| * lib/types: make pattern of strMatching accessibleJohannes Kirschbauer2024-10-231-0/+5
* | lib.types: chore use consistent payload form (#363565)Silvan Mosberger2024-12-091-4/+9
|\ \
| * | lib.types: chore use consistent payload formJohannes Kirschbauer2024-12-091-4/+9
* | | lib.types.attrsWith: add placeholder parameterJohannes Kirschbauer2024-12-091-5/+15
|/ /
* | lib.types: improve performance on attrsWithJohannes Kirschbauer2024-12-031-21/+21
* | lib/types: standardise attrsOf functor.wrapped warning and add a testSilvan Mosberger2024-12-031-6/+2
* | lib/types: Add deprecation to attrsWith•••Co-Authored-By: @infinisil Silvan Mosberger2024-12-031-14/+24
* | lib/types: Test attrsWith type merging•••Co-Authored-By: @hsjobeki Silvan Mosberger2024-12-031-1/+2
* | lib/types: init {types.attrsWith}Johannes Kirschbauer2024-12-031-31/+58
* | Revert "lib/types: init {types.attrsWith}"K9002024-12-031-76/+42
* | lib.types: improve performance on attrsWithJohannes Kirschbauer2024-12-021-21/+21
* | lib/types: standardise attrsOf functor.wrapped warning and add a testSilvan Mosberger2024-12-021-6/+2
* | lib/types: Add deprecation to attrsWith•••Co-Authored-By: @infinisil Silvan Mosberger2024-11-261-14/+24
* | lib/types: Test attrsWith type merging•••Co-Authored-By: @hsjobeki Silvan Mosberger2024-11-251-1/+2
* | lib/types: init {types.attrsWith}Johannes Kirschbauer2024-11-251-31/+58
* | lib.types.defaultTypeMerge: refactor functor.{payload,wrapped} mergingJohannes Kirschbauer2024-11-191-14/+28
|/
* lib.types.anything: remove custom logic for lists (#340202)Robert Hensing2024-09-181-6/+0
|\
| * lib.types.anything: remove custom logic for lists (default to 'mergeEqualOpti...•••Previously, for values of type list, the merge function would only retain the value if the number of option definitions was less than or equal to 1, and would throw an error for conflicting definitions to avoid potentially unwanted list merges. This change removes that logic, defaulting to the 'mergeEqualOption' function for values of type list. This approach maintains the same safeguard against merging different lists while allowing lists with identical values to be merged. Alexis Destrez2024-09-071-6/+0
* | lib/types: fix toCoerced's typeMergeHexoKnight2024-09-101-1/+1
|/
* lib/types: update reference to docs•••The XML docs have been migrated to markdown since bfd21cd2c1492b799facdab2e77308c34edbe9e7 Matt Sturgeon2024-08-161-1/+1
* lib.types: remove __attrsFailEvaluation•••The test (`nix-build pkgs/test/release/default.nix`) continues to pass without this preventative measure. Philip Taron2024-07-011-1/+0
* Merge pull request #284551 from hercules-ci/types-attrTag•••Add `types.attrTag`Silvan Mosberger2024-04-091-1/+101
|\
| * types.attrTag: Remove unnecessary definitions override ••• Committing because tests pass. Co-authored-by: Silvan Mosberger <github@infinisil.com>Robert Hensing2024-04-041-1/+0
| * lib.types.attrTag: Fix declarationPositions after mergeRobert Hensing2024-04-041-1/+1
| * types.attrTag: Remove substSubmodules•••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. Robert Hensing2024-04-041-9/+0
| * types.attrTagWith: remove•••Keep it simple for now. Robert Hensing2024-04-041-10/+18
| * lib.types.attrTag: Custom error when passing bare typeRobert Hensing2024-04-041-1/+8
| * lib.types.attrTag: Remove tags from description•••You can find them in the sub-options now. Robert Hensing2024-04-041-1/+2
| * lib.types.attrTag: Provide declarations, definitionsRobert Hensing2024-04-041-2/+19
| * lib/types.nix: Fix getSubOptions doc•••This comment was added in 73f32d03758a5, when it was already supposed to be an attrset. Robert Hensing2024-04-041-1/+1