summaryrefslogtreecommitdiff
path: root/lib/tests/modules (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib/modules: add suggestions to invalid option name errors (#442263)Silvan Mosberger2026-02-036-0/+184
|\
| * lib/modules: Fix suggestions in submodulesRobert Hensing2025-10-282-0/+70
| * lib/modules: Support multiple suggestions, optimizeRobert Hensing2025-10-282-0/+78
| * lib/modules: add suggestions to invalid option name errors•••This change introduces the suggesting of possible valid option names for a given invalid option, based on the keys of said invalid option's parent attrset. That is, `foo.bar.baz` will only be suggested keys from `foo.bar`, while `(config).baz` will only be suggested keys from the toplevel. Winter2025-09-112-0/+36
* | lib/types: add tests for types.mkStructuredTypeJohannes Kirschbauer2026-01-201-0/+32
* | lib/types: add externalPathFelix Buehler2025-11-041-0/+8
* | lib.types: introduce a `fileset` type (#428293)Robert Hensing2025-11-042-0/+51
|\ \
| * | lib.types: add module tests for `fileset`Niols2025-08-292-0/+51
* | | lib/modules: Report error for unsupported `t // { check = ...; }` (#454964)Robert Hensing2025-10-281-0/+117
|\ \ \
| * | | lib/modules: Report error for unsupported // { check }•••`check` can have a new place since the introduction of merge.v2. This makes the // { check = ... } idiom unreliable. In this PR we add checks to detect and report this. merge.v2 introduced in: https://github.com/NixOS/nixpkgs/pull/391544 Real world case: https://hercules-ci.com/github/hercules-ci/hercules-ci-effects/jobs/875 Robert Hensing2025-10-231-0/+117
* | | | treewide: remove deprecated lib functions that had warning for more than 2 yearsAliaksandr2025-10-241-1/+1
|/ / /
* | | treewide: remove redundant parentheses•••Auto-fixed by nixf-diagnose. Wolfgang Walther2025-10-054-17/+17
* | | lib: remove optional builtins prefixes from prelude functions•••Remove optional builtins prefixes from prelude functions by running: builtins=( abort baseNameOf break derivation derivationStrict dirOf false fetchGit fetchMercurial fetchTarball fetchTree fromTOML import isNull map null placeholder removeAttrs scopedImport throw toString true ) fd --type file . lib --exec-batch sed --in-place --regexp-extended " s/\<builtins\.($( printf '%s\n' "${builtins[@]}" | paste --delimiter '|' --serial - ))\>/\1/g " nix fmt NAHO2025-09-303-3/+3
* | | lib/types: submodule fix description with freeformType (#443134)Johannes Kirschbauer2025-09-251-0/+459
|\ \ \
| * | | lib/tests/modules: Test description compositionRobert Hensing2025-09-171-0/+459
| |/ /
* / / lib/types.either: add tests for warning in legacy caseJohannes Kirschbauer2025-09-064-0/+85
|/ /
* | types/addCheck: add tests for merge v1 and v2Johannes Kirschbauer2025-08-131-0/+36
* | types/merge: move 'configuration' of submodules into nested attribute setJohannes Kirschbauer2025-08-131-2/+2
* | lib.modules: add tests for option valueMetaJohannes Kirschbauer2025-08-132-0/+135
* | lib.evalModules: add graph attribute•••Co-authored-by: Ali Jamadi <jamadi1377@gmail.com> Shahar "Dawn" Or2025-08-073-0/+75
|/
* treewide: run nixfmt 1.0.0Wolfgang Walther2025-07-242-16/+14
* lib.types.attrTag: expose suboptions at correct levelsodiboo2025-06-221-1/+1
* modules: Add `_prefix` module argument, improve error, add docs (#398839)Johannes Kirschbauer2025-06-192-0/+35
|\
| * lib.modules: Add prefix to imports type check errorRobert Hensing2025-04-151-0/+18
| * lib.modules: Add _prefix module argumentRobert Hensing2025-04-151-0/+17
* | lib.options.mkPackageOption: use lib.showAttrPath (#398066)Johannes Kirschbauer2025-04-211-0/+14
|\ \
| * | lib.options.mkPackageOption: use lib.showAttrPath•••Make use of `lib.showAttrPath` instead of manually doing `concatStringsSep "."`. This means edge-cases such as the attr-path including names that are not valid nix identifiers will be handled better. See: - https://nix.dev/manual/nix/2.26/language/identifiers - https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.showAttrPath Matt Sturgeon2025-04-131-0/+14
| |/
* | lib/types: check paths in pathWith with hasStorePathPrefix (#387304)Johannes Kirschbauer2025-04-211-0/+3
|\ \ | |/ |/|
| * 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-0/+3
* | lib/modules: add `class` to `specialArgs`•••Co-Authored-By: Johannes Kirschbauer <hsjobeki@gmail.com> Michael Hoang2025-04-105-1/+92
* | lib.modules: init test for lib.mkDefinitionJohannes Kirschbauer2025-04-031-0/+71
|/
* 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-1/+2
* lib/types: types.either deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-201-0/+10
* lib/types: types.coercedTo deprecate functor.wrapped in favor of functor.payl...Johannes Kirschbauer2025-03-151-1/+7
* lib/types: types.functionTo deprecate functor.wrapped in favor of functor.pay...Johannes Kirschbauer2025-03-151-0/+11
* lib/types: types.nullOr deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-151-0/+11
* lib/types: types.{unique,uniq} deprecate functor.wrapped in favor of functor....Johannes Kirschbauer2025-03-151-0/+11
* lib.types: improve tests for deprecation warning on all migrated typesJohannes Kirschbauer2025-02-191-0/+44
* 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-0/+88
* treewide: Fix incorrect string escapespiegames2025-01-071-2/+2
* treewide: format all inactive Nix files•••After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7 result/bin/apply-formatting $NIXPKGS_PATH Silvan Mosberger2024-12-1086-393/+680
* lib/types: make pattern of strMatching accessible (#350467)Silvan Mosberger2024-12-091-0/+15
|\
| * lib.types: Add test for merging strMatchingSilvan Mosberger2024-12-091-0/+15
* | lib.types.attrsWith: add placeholder parameterJohannes Kirschbauer2024-12-092-0/+89
* | lib/types: Test attrsWith type merging•••Co-Authored-By: @hsjobeki Silvan Mosberger2024-12-031-17/+29
* | lib/types: init {types.attrsWith}Johannes Kirschbauer2024-12-031-0/+45
* | Revert "lib/types: init {types.attrsWith}"K9002024-12-031-57/+0
* | lib/types: Test attrsWith type merging•••Co-Authored-By: @hsjobeki Silvan Mosberger2024-11-251-17/+29
* | lib/types: init {types.attrsWith}Johannes Kirschbauer2024-11-251-0/+45
* | lib.types.defaultTypeMerge: refactor functor.{payload,wrapped} mergingJohannes Kirschbauer2024-11-191-0/+28
|/