about summary refs log tree commit diff
path: root/lib/tests
AgeCommit message (Collapse)AuthorFilesLines
2024-06-09lib/tests/release.nix: fix pkgs.lib error by passing libTristan Ross1-2/+1
2024-06-06lib/tests/release.nix: make pureTristan Ross1-1/+4
2024-05-22cli.nix: permit separators between args -> `-a=b`, `--xyz=abc`, etcRob Pilling1-0/+21
2024-05-01Merge pull request #308032 from obsidiansystems/freebsd-no-suffix-versionJohn Ericson1-3/+3
treewide: freebsd13 -> freebsd
2024-04-30treewide: freebsd13 -> freebsdJohn Ericson1-3/+3
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-28nixVersions.unstable: build from master, re-init at 2.22.0.pre20240321_6fd2f42cMaximilian Bosch1-1/+1
The idea behind that is to enable users and developers of downstream tools such as home-manager to test Nix master for several reasons: * Nix is currently trying to have a `master` branch that's always releasable[1]. We're still on Nix 2.18 in nixpkgs due to too many notable regressions. Enabling people to test latest master may help on that end. * This uses the most bleeding-edge Nix, but our packaging, so we can identify issues with our packaging early. * From what I've seen, most people are using the packages from nixpkgs anyways instead of the upstream flake, this is far more convenient anyways. My plan is to update this once a week. Right now we rely on the `installCheckPhase` here, but as soon as we have proper regression testing[2], we may want to add `nixUnstable` there as well (however with failures being allowed probably). [1] https://discourse.nixos.org/t/nix-release-schedule-and-roadmap/14204 [2] https://github.com/NixOS/nixpkgs/pull/304332
2024-04-22lib.lists.ifilter0: initSilvan Mosberger1-0/+27
2024-04-15lib/tests: apply lintsGabriel Volpe1-9/+4
2024-04-15lib/attrsets: introduce mapCartesianProductGabriel Volpe1-0/+25
2024-04-15tree-wide: use cartesianProductGabriel Volpe1-6/+6
2024-04-09Merge pull request #284551 from hercules-ci/types-attrTagSilvan Mosberger4-0/+202
Add `types.attrTag`
2024-04-04Merge pull request #301556 from edef1c/lib-xorSilvan Mosberger1-0/+16
lib: add xor
2024-04-04lib: add xoredef1-0/+16
This gets clumsily reimplemented in various places, to no useful end.
2024-04-04doc: migrate trivial files to doc-comment format (#299986)Johannes Kirschbauer2-17/+21
* 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-04lib.types.attrTag: Fix declarationPositions after mergeRobert Hensing1-3/+17
2024-04-04lib/tests/modules/types-attrTag.nix: Test other option doc attrsRobert Hensing1-0/+9
2024-04-04lib/tests/modules/types-attrTag.nix: Clean up unneeded commentRobert Hensing1-1/+0
2024-04-04types.attrTagWith: removeRobert Hensing1-1/+1
Keep it simple for now.
2024-04-04lib.types.attrTag: Custom error when passing bare typeRobert Hensing2-0/+15
2024-04-04lib/tests/modules/types-attrTag: Test against unexpected attrsRobert Hensing1-6/+6
Thank you lheckemann for pointing this out!
2024-04-04lib.types.attrTag: Remove tags from descriptionRobert Hensing1-6/+6
You can find them in the sub-options now.
2024-04-04lib.types.attrTag: Provide declarations, definitionsRobert Hensing1-0/+1
2024-04-04lib.types.attrTag: Support type mergingRobert Hensing1-0/+10
2024-04-04lib.types.attrTag: Take options instead of typesRobert Hensing1-15/+34
2024-04-04lib.types.attrTag: Support module docsRobert Hensing2-0/+60
2024-04-02lib/strings: Add makeIncludePath (#296237)Florian Richer1-0/+30
* Update strings.nix * Fix typo in docs * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Add unit test with strings * Move test to strings * Add unit test with package structure * testMakeIncludePathWithPkgs: use real pkgs * Revert "testMakeIncludePathWithPkgs: use real pkgs" This reverts commit fb1850c069cfb324f3a43323da740a27a11793f3. * Update lib/tests/misc.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/tests/misc.nix Co-authored-by: Silvan Mosberger <github@infinisil.com> --------- Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-03-11Avoid top-level `with` in lib/tests/misc.nixPhilip Taron1-1/+88
2024-03-11Avoid top-level `with ...;` in ↵Philip Taron1-1/+8
lib/tests/modules/extendModules-168767-imports.nix
2024-03-11Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority.nixPhilip Taron1-3/+10
2024-03-11Avoid top-level `with ...;` in ↵Philip Taron1-3/+10
lib/tests/modules/alias-with-priority-can-override.nix
2024-03-06Merge pull request #292209 from hercules-ci/lazyDerivation-multi-outputSilvan Mosberger1-0/+18
lib.lazyDerivation: Support multi-output derivations
2024-03-03Merge pull request #177977 from thefloweringash/call-packages-with-function-argsArtturi1-0/+18
lib/customization: propagate function arguments in callPackagesWith
2024-02-29lib.lazyDerivation: Support multi-output derivationsRobert Hensing1-0/+18
2024-02-28lib/customization: propagate function arguments in callPackagesWithAndrew Childs1-0/+18
makeOverridable is very careful to ensure the arguments to the overridden function are the same as the input function. As a result, the arguments of hello.override are exactly the same as the original arguments of the hello function that produced the derivation. However, callPackagesWith calls makeOverridable with a lambda that does not propagate the arguments. The override function for a package instantiated with callPackagesWith will not have the original arguments. For example: nix-repl> lib.functionArgs hello.override { callPackage = false; fetchurl = false; hello = false; lib = false; nixos = false; stdenv = false; testers = false; } nix-repl> lib.functionArgs openssl.override { } By copying the arguments onto the inner lambda before passing it to makeOverridable, we can make callPackage and callPackages behave the same. nix-repl> lib.functionArgs openssl.override { buildPackages = false; coreutils = false; cryptodev = false; enableSSL2 = true; enableSSL3 = true; fetchurl = false; lib = false; perl = false; removeReferencesTo = false; static = true; stdenv = false; withCryptodev = true; withPerl = true; }
2024-02-26lib/tests/release: Test lib.version in isolationRobert Hensing1-0/+6
2024-02-26.version: Make lib/.version source of truthRobert Hensing1-9/+0
This way we don't have to make sure they're in sync, and we remove a small step from the release process.
2024-02-26lib flake: Fix versionRobert Hensing1-0/+9
Manually tested with nix-repl> :lf path:lib nix-repl> lib.version
2024-02-23lib/tests/test-with-nix.nix: initRobert Hensing2-54/+71
See https://github.com/NixOS/nix/pull/9900
2024-02-11lib.types.attrTag: initRobert Hensing2-0/+75
2024-02-10Merge pull request #284512 from hercules-ci/lib-types-unique-mergeSilvan Mosberger2-0/+37
lib.types.unique: Check inner type deeply
2024-02-05Merge pull request #285612 from hercules-ci/doRename-conditionRobert Hensing5-0/+74
lib.modules.doRename: Add condition parameter
2024-02-05Merge pull request #285353 from sternenseemann/nix-2.3-syntaxSilvan Mosberger2-0/+2
treewide: fix parse errors with Nix 2.3 and related problems
2024-02-02lib: Add optionalDrvAttr to conditionally set drv attributes.Shea Levy1-1/+19
This allows for adding new, conditionally set, derivation attributes to an existing derivation without changing any output paths in the case where the condition is not met.
2024-02-02lib.modules.doRename: Add condition parameterRobert Hensing5-0/+74
This is to support single-to-multi service migrations, so that the `to` (e.g. `foos.""`) isn't defined unconditionally. See test cases.
2024-01-31lib/tests/packages-from-directory: make sure all .nix files parsesternenseemann2-0/+2
It is useful that all (or almost all) .nix files in nixpkgs at least parse since it allows for checking syntax in the repository programmatically without evaluating anything.
2024-01-30feat: add test for nonEmptyListOf submoduleDanila Danko2-0/+8
2024-01-28lib.types.unique: Check inner type deeplyRobert Hensing2-0/+37
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-0/+12
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-19Merge pull request #270537 from 9999years/packagesFromDirectorySilvan Mosberger12-0/+49
lib.packagesFromDirectoryRecursive: init
2023-12-19lib.packagesFromDirectoryRecursive: initRebecca Turner12-0/+49
Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>