summaryrefslogtreecommitdiff
path: root/lib/tests (follow)
Commit message (Expand)AuthorAgeFilesLines
* init: lib.foldlAttrs•••- provide comprehensive example - add unit test hsjobeki2023-03-111-0/+31
* Merge pull request #211855 from hercules-ci/lib-modules-disabledModules-modul...•••lib/modules: Allow an "anonymous" module with key in disabledModulesRobert Hensing2023-03-095-0/+145
|\
| * lib/modules: Allow an "anonymous" module with key in disabledModules•••This makes the following work disabledModules = [ foo.nixosModules.bar ]; even if `bar` is not a path, but rather a module such as { key = "/path/to/foo#nixosModules.bar"; config = ...; } By supporting this, the user will often be able to use the same syntax for both importing and disabling a module. This is becoming more relevant because flakes promote the use of attributes to reference modules. Not all of these modules in flake attributes will be identifiable, but with the help of a framework such as flake-parts, these attributes can be guaranteed to be identifiable (by outPath + attribute path). Robert Hensing2023-03-015-0/+145
* | strings: add escapeQuery for url encodingPatrick Widmer2023-03-031-0/+9
|/
* Merge pull request #206611 from h7x4/lib-lists-add-repeat•••lib.lists: add `replicate`Silvan Mosberger2023-02-071-0/+5
|\
| * lib.lists: add `replicate`•••`replicate` returns n copies of an element as a list. Co-Authored-By: Silvan Mosberger <contact@infinisil.com> h7x42023-02-061-0/+5
* | Merge pull request #205557 from ncfavier/concatLines•••lib/strings: add `concatLines`Silvan Mosberger2023-01-311-0/+5
|\ \
| * | lib/strings: add `concatLines`•••Like `unlines` from Haskell. The aim is to replace the `concatStringsSep "\n"` pattern for generated files, which doesn't add a final newline. Naïm Favier2022-12-101-0/+5
* | | maintainers: clarify what fields are requiredNaïm Favier2023-01-271-0/+1
* | | maintainers: disallow `noreply.github.com` emailsNaïm Favier2023-01-271-0/+2
* | | maintainers: make `email` optional•••Not giving an email address is fine as long as the maintainer is reachable through other means, such as GitHub or Matrix. Naïm Favier2023-01-272-3/+6
* | | Merge pull request #211622 from alyssais/valgrind-platforms•••valgrind: make meta.platforms more accurateJohn Ericson2023-01-191-0/+3
|\ \ \
| * | | lib.platforms.s390x: initAlyssa Ross2023-01-191-0/+1
| * | | lib.platforms.power: initAlyssa Ross2023-01-191-0/+1
| * | | lib.platforms.armv7: initAlyssa Ross2023-01-191-0/+1
* | | | lib/tests/release.nix: Make nix a parameter + strictDeps•••This makes bisecting nix a bit easier. Example reproducer, invoked from nix directory: ```bash nix-build ../nixpkgs/lib/tests/release.nix --arg nix '(builtins.getFlake "git+file://${toString ./.}").packages.x86_64-linux.default' ``` Robert Hensing2023-01-181-3/+7
|/ / /
* | | Merge pull request #205190 from NixOS/lib.path.relativeNormalise•••lib.path.subpath.{isValid,normalise}: initRobert Hensing2023-01-031-0/+3
|\ \ \
| * | | lib.path.subpath.isValid: init•••The first path library function Silvan Mosberger2023-01-031-0/+3
* | | | lib/versions: add `pad`•••Pad a version string with zeros to match a given number of components. Naïm Favier2022-12-211-0/+15
|/ / /
* | / lib: fix typosfigsoda2022-12-171-1/+1
| |/ |/|
* | Merge pull request #205457 from h7x4/lib-strings-toInt-broken-for-negative-nu...•••lib.strings: fix negative number handling for `toInt` and `toIntBase10`Robert Hensing2022-12-111-0/+4
|\ \ | |/ |/|
| * lib.strings: fix negative number handling for `toInt` and `toIntBase10`•••The previous version would be unstable due to an input validation regex not expecting a '-' in front of the number. h7x42022-12-101-0/+4
* | nixos/doc: render option values using `lib.generators.toPretty`•••Render un`_type`d defaults and examples as `literalExpression`s using `lib.generators.toPretty` so that consumers don't have to reinvent Nix pretty-printing. `renderOptionValue` is kept internal for now intentionally. Make `toPretty` print floats as valid Nix values (without a tilde). Get rid of the now-obsolete `substSpecial` function. Move towards disallowing evaluation of packages in the manual by raising a warning on `pkgs.foo.{outPath,drvPath}`; later, this should throw an error. Instead, module authors should use `literalExpression` and `mkPackageOption`. Naïm Favier2022-12-081-1/+1
* | lib/generators.toPretty: escape strings properlyNaïm Favier2022-12-081-8/+8
* | lib/generators.toPretty: don't evaluate derivations•••With the goal of making `toPretty` suitable for rendering option values, render derivations as `<derivation foo-1.0>` instead of `<derivation /nix/store/…-foo-1.0.drv>`. This is to avoid causing sudden evaluation errors for out-of-tree projects that have options with `default = pkgs.someUnfreePackage;` and no `defaultText`. Naïm Favier2022-12-081-1/+1
* | lib/modules: Add context to the "option does not exist" error•••Add trace items that provide context for a failed definition that can not be caught within the Nix language. This also adds a test for the `tryEval` behavior of `showDefs`. Robert Hensing2022-12-023-0/+9
* | lib/attrsets: add concatMapAttrsfigsoda2022-11-171-0/+17
* | lib/systems: Support FreeBSD•••A tricky thing about FreeBSD is that there is no stable ABI across versions. That means that putting in the version as part of the config string is paramount. We have a parsed represenation that separates name versus version to accomplish this. We include FreeBSD versions 12 and 13 to demonstrate how it works. John Ericson2022-11-041-3/+3
|/
* lib/tests/modules: Test doRenameorigin/doRename-no-warningRobert Hensing2022-11-033-0/+32
* lib/strings: Update docs and restructured code to improve readability of toIn...Jacob Abel2022-10-232-1/+5
* lib/strings: Refactor toInt into toInt and toIntBase10Jacob Abel2022-10-232-17/+45
* lib/strings: Update toInt to handle intermixed ws and zeros. Added testsJacob Abel2022-10-232-1/+12
* lib/strings: allow toInt to parse zero-padded stringsJacob Abel2022-10-231-0/+28
* lib/tests/misc: Add tests for charToInt, escapeC, and normalizePathDaniel Olsen2022-10-201-0/+15
* 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 #193132 from figsoda/clean-up•••treewide: clean upfigsoda2022-10-011-1/+0
|\
| * lib/tests/maintainers.nix: remove unused bindingfigsoda2022-09-261-1/+0
* | lib/modules: Fix meta duplication in shorthand syntaxRobert Hensing2022-09-212-0/+22
* | lib: Add lazyDerivationRobert Hensing2022-09-211-0/+53
|/
* lib.types: Add parentheses where description is ambiguousRobert Hensing2022-09-171-0/+53
* Merge pull request #188289 from erikarvstedt/fix-disabled-modules-abs-paths•••lib.modules: support strings with absolute paths in `disabledModules`Robert Hensing2022-08-312-0/+6
|\
| * lib.modules: support strings with absolute paths in `disabledModules`•••This is particularly useful for disabling modules defined in a flake. Example: disabledModules = [ "${flake}/modules/mymodule.nix" ]; Previously, absolute string paths were internally prepended with `modulesPath`, which caused the module filtering to fail. Erik Arvstedt2022-08-312-0/+6
* | lib/systems: add MicroBlaze architecturesMinijackson2022-08-251-1/+1
|/
* teams/maintainers list: show instructions for validating the contentsGraham Christensen2022-06-201-2/+2
* maintainer teams: check them in lib testsGraham Christensen2022-06-202-0/+54
* maintainer lib test: extract maintainer moduleGraham Christensen2022-06-202-31/+32
* maintainers: remove longkeyid•••see https://dkg.fifthhorseman.net/blog/openpgp-key-ids-are-not-useful.html Graham Christensen2022-06-201-1/+0
* lib/modules: Throw earlier when module function does not return attrs•••`m` must always be an attrset at this point. It is basically always evaluated. This will make it throw when any of the attrs is accessed, rather than just `config`. We assume that this will improve the error message in more scenarios. Robert Hensing2022-06-142-0/+21
* lib.deferredModule: Make it properly singularRobert Hensing2022-06-141-1/+1
* lib.types.deferredModule: Allow path-typed module referencesRobert Hensing2022-06-142-3/+4