summaryrefslogtreecommitdiff
path: root/lib/tests (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib.takeEnd: init (#398222)Johannes Kirschbauer2025-04-231-0/+63
|\
| * lib.takeEnd: initazahi2025-04-131-0/+63
* | lib.strings: init splitStringBy (#385643)Pol Dellaiera2025-04-231-0/+95
|\ \
| * | lib.strings: init splitStringByHeitor Augusto2025-04-071-0/+95
* | | lib/strings: Zero‐pad hex digits in escapeC (#399722)Norbert Melzer2025-04-211-2/+2
|\ \ \
| * | | lib/strings: Zero‐pad hex digits in escapeC•••lib.strings.escapeC produces single‐digit hexadecimal strings for character values ≤ 15, which results in an ambiguity. If the following character is a hex digit, it will be interpreted as being part of the escape sequence. systemd, which also relies on C‐style escape sequences, does not decode single‐digit sequences at all, even if unambiguous. Padding the hexadecimal string with "0" avoids this problem. Mikael Voss2025-04-181-2/+2
| | |/ | |/|
* | | lib.options.mkPackageOption: use lib.showAttrPath (#398066)Johannes Kirschbauer2025-04-212-1/+27
|\ \ \
| * | | 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-132-0/+17
| * | | lib/tests/modules: test all `mkPackageOption` cases•••There were several test case options declared in `declare-mkPackageOption.nix` that were not actually tested in `modules.sh`. Matt Sturgeon2025-04-131-1/+10
| |/ /
* | | 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
* | | Merge remote-tracking branch 'origin/master' into staging-nextK9002025-04-111-0/+36
|\ \ \
| * \ \ lib.types.submodule: Disable check during docs generation (#396907)Robert Hensing2025-04-111-0/+36
| |\ \ \
| | * | | 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-0/+36
| | |/ /
* | | | Merge master into staging-nextnixpkgs-ci[bot]2025-04-116-1/+104
|\| | |
| * | | lib/modules: export `class` inside `specialArgs` (#395141)Robert Hensing2025-04-106-1/+104
| |\ \ \
| | * | | lib/modules: add `class` to `specialArgs`•••Co-Authored-By: Johannes Kirschbauer <hsjobeki@gmail.com> Michael Hoang2025-04-106-1/+104
| | | |/ | | |/|
* | | | Merge master into staging-nextnixpkgs-ci[bot]2025-04-091-1/+1
|\| | |
| * | | nixVersions.{nix_2_28,nix_2_26}: switch simplified meson build•••So we are adding a simplified version that builds a monolithic nix binary to get finished in time for the release. Afterwards we will switch to the modular build again. Jörg Thalheim2025-04-081-1/+1
| |/ /
* | | Merge remote-tracking branch 'origin/master' into staging-nextK9002025-04-072-0/+79
|\| |
| * | lib.modules: init test for lib.mkDefinitionJohannes Kirschbauer2025-04-032-0/+79
| |/
* / treewide: drop support for 32‐bit Darwin•••It’s dead, Jim. Emily2025-04-021-5/+0
|/
* 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-014-785/+2281
* lib/tests/release.nix: Use nix.overrideScope for >=2.26Robert Hensing2025-03-311-15/+4
* nixVersions.nix_2_26: Fix cross and staticRobert Hensing2025-03-261-1/+17
* lib.packagesFromDirectoryRecursive: default to creating new scopes when `newS...••• Co-authored-by: Rebecca Turner <rbt@sent.as> nicoo2025-03-261-6/+0
* lib.packagesFromDirectoryRecursive: add tests for nested scopesnicoo2025-03-2612-0/+58
* lib/tests: move `packages-from-directory/*` into a subdir•••in preparation for adding more tests for `lib.packagesFromDirectoryRecursive` nicoo2025-03-2412-2/+2
* lib/types: types.either deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-202-0/+18
* lib/types: types.coercedTo deprecate functor.wrapped in favor of functor.payl...Johannes Kirschbauer2025-03-152-1/+13
* lib/types: types.functionTo deprecate functor.wrapped in favor of functor.pay...Johannes Kirschbauer2025-03-152-0/+17
* lib/types: types.nullOr deprecate functor.wrapped in favor of functor.payload...Johannes Kirschbauer2025-03-152-2/+19
* lib/types: types.{unique,uniq} deprecate functor.wrapped in favor of functor....Johannes Kirschbauer2025-03-152-2/+19
* lib/strings: allow CA paths in isStorePathMikael Voss2025-03-051-0/+10
* 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-0/+15
* lib.types: Make functor.wrapped deprecation work in unprocessed types (#382848)Johannes Kirschbauer2025-02-212-3/+61
|\
| * lib.types: improve tests for deprecation warning on all migrated typesJohannes Kirschbauer2025-02-192-3/+61
* | lib.strings: init toSentenceCase (#381802)Johannes Kirschbauer2025-02-201-0/+9
|\ \ | |/ |/|
| * lib.strings: init toSentenceCaseisabel2025-02-191-0/+9
* | Revert "lib.types.attrsWith: remove failing test"•••This reverts commit ce8f304bb68f88be5e32975c3299f2e16abe05c0. The problem was simply a typo (nestedTypes.elemType -> type.nestedTypes.elemType) ! And CI didn't run for lib in the orginal PR which is why it didn't get caught. Silvan Mosberger2025-02-171-0/+4
* | 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-152-0/+124
* | lib.types: init mergeTypes (#364620)Johannes Kirschbauer2025-02-101-0/+41
|\ \
| * | lib.types: init mergeTypesJohannes Kirschbauer2025-02-101-0/+41
* | | lib/modules: tests change expected error for class mismatchJohannes Kirschbauer2025-01-291-3/+3
| |/ |/|
* | `lib.dropEnd` (#370558)Silvan Mosberger2025-01-131-0/+24
|\ \
| * | lib.dropEnd: init•••Naming borrowed from Haskell - `base`: [`dropWhileEnd`] - `extra`, `mono-traversable`, ...: [`dropEnd`] [`dropEnd`]: https://hackage.haskell.org/package/mono-traversable-1.0.21.0/docs/Data-Sequences.html#v:dropEnd [`dropWhileEnd`]: https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List.html#v:dropWhileEnd Robert Hensing2025-01-031-0/+12
| * | lib/tests/misc: Test lib.dropRobert Hensing2025-01-031-0/+12
* | | treewide: Fix incorrect string escapespiegames2025-01-071-2/+2
|/ /
* | lib.generators.toPlist: escape XML syntax in strings & keys (#356502)Silvan Mosberger2024-12-233-2/+76
|\ \
| * | lib.generators.toPlist: escape XML syntax in strings & keys•••Before this patch, code like this would break generate invalid XML: lib.generators.toPlist {} "ab<cd" That's obviously bad, since the call to toPlist often happens through indirection, as is the case in e.g. the nix-darwin project. A user might not realize that they have to escape the strings. This patch adds the argument 'escape' to lib.generators.plist and emits a warning if it is not set to true. In a future release, this behavior should become the default. I have also added a note for future maintainers, in case I forget to actually remove the deprecated functionality in a future release. Linnnus2024-12-233-2/+76