summaryrefslogtreecommitdiff
path: root/lib/tests (follow)
Commit message (Expand)AuthorAgeFilesLines
* Merge pull request #318712 from woojiq/lib-network-ipv6-parser•••lib.network: add ipv6 parserJanik2024-07-113-0/+136
|\
| * lib.network: ipv6 parser from string•••Add a library function to parse and validate an IPv6 address from a string. It can parse the first two versions of an IPv6 address according to https://datatracker.ietf.org/doc/html/rfc4291#section-2.2. The third form "x:x:x:x:x:x.d.d.d.d" is not yet implemented. Optionally parser can accept prefix length (128 is default). Add shell script network.sh to test IPv6 parser functionality. woojiq2024-06-292-0/+120
| * lib: add fromHexString•••Co-authored-by: lucasew <lucas59356@gmail.com> lucasew2024-06-281-0/+16
* | lib/modules: Use fixed lib instead of args.lib•••The practical use for this should be very limited because I don't think anyone should change `lib`, let alone change `lib.functionArgs`, but, but it would be even stranger to rely on `args.lib` (or really `specialArgs.lib` for what's clearly a behavior of the current `evalModules`, which uses its own ambient lib for basically everything. The shadowing of `lib` by `args.lib` here seems to be a small mistake, which is easy to make. Robert Hensing2024-07-032-0/+30
|/
* lib/tests/release.nix: fix pkgs.lib error by passing libTristan Ross2024-06-091-2/+1
* lib/tests/release.nix: make pureTristan Ross2024-06-061-1/+4
* cli.nix: permit separators between args -> `-a=b`, `--xyz=abc`, etcRob Pilling2024-05-221-0/+21
* Merge pull request #308032 from obsidiansystems/freebsd-no-suffix-version•••treewide: freebsd13 -> freebsdJohn Ericson2024-05-011-3/+3
|\
| * treewide: freebsd13 -> freebsd•••Co-authored-by: Alyssa Ross <hi@alyssa.is> John Ericson2024-04-301-3/+3
* | nixVersions.unstable: build from master, re-init at 2.22.0.pre20240321_6fd2f42c•••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 Maximilian Bosch2024-04-281-1/+1
|/
* lib.lists.ifilter0: initSilvan Mosberger2024-04-221-0/+27
* lib/tests: apply lintsGabriel Volpe2024-04-151-9/+4
* lib/attrsets: introduce mapCartesianProductGabriel Volpe2024-04-151-0/+25
* tree-wide: use cartesianProductGabriel Volpe2024-04-151-6/+6
* Merge pull request #284551 from hercules-ci/types-attrTag•••Add `types.attrTag`Silvan Mosberger2024-04-094-0/+202
|\
| * lib.types.attrTag: Fix declarationPositions after mergeRobert Hensing2024-04-041-3/+17
| * lib/tests/modules/types-attrTag.nix: Test other option doc attrsRobert Hensing2024-04-041-0/+9
| * lib/tests/modules/types-attrTag.nix: Clean up unneeded commentRobert Hensing2024-04-041-1/+0
| * types.attrTagWith: remove•••Keep it simple for now. Robert Hensing2024-04-041-1/+1
| * lib.types.attrTag: Custom error when passing bare typeRobert Hensing2024-04-042-0/+15
| * lib/tests/modules/types-attrTag: Test against unexpected attrs•••Thank you lheckemann for pointing this out! Robert Hensing2024-04-041-6/+6
| * lib.types.attrTag: Remove tags from description•••You can find them in the sub-options now. Robert Hensing2024-04-041-6/+6
| * lib.types.attrTag: Provide declarations, definitionsRobert Hensing2024-04-041-0/+1
| * lib.types.attrTag: Support type mergingRobert Hensing2024-04-041-0/+10
| * lib.types.attrTag: Take options instead of typesRobert Hensing2024-04-041-15/+34
| * lib.types.attrTag: Support module docsRobert Hensing2024-04-042-0/+60
| * lib.types.attrTag: initRobert Hensing2024-02-112-0/+75
* | Merge pull request #301556 from edef1c/lib-xor•••lib: add xorSilvan Mosberger2024-04-041-0/+16
|\ \
| * | lib: add xor•••This gets clumsily reimplemented in various places, to no useful end. edef2024-04-041-0/+16
* | | doc: migrate trivial files to doc-comment format (#299986)•••* 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>Johannes Kirschbauer2024-04-042-17/+21
|/ /
* | lib/strings: Add makeIncludePath (#296237)•••* 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>Florian Richer2024-04-021-0/+30
* | Avoid top-level `with` in lib/tests/misc.nixPhilip Taron2024-03-111-1/+88
* | Avoid top-level `with ...;` in lib/tests/modules/extendModules-168767-imports...Philip Taron2024-03-111-1/+8
* | Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority.nixPhilip Taron2024-03-111-3/+10
* | Avoid top-level `with ...;` in lib/tests/modules/alias-with-priority-can-over...Philip Taron2024-03-111-3/+10
* | Merge pull request #292209 from hercules-ci/lazyDerivation-multi-output•••lib.lazyDerivation: Support multi-output derivationsSilvan Mosberger2024-03-061-0/+18
|\ \
| * | lib.lazyDerivation: Support multi-output derivationsRobert Hensing2024-02-291-0/+18
* | | Merge pull request #177977 from thefloweringash/call-packages-with-function-args•••lib/customization: propagate function arguments in callPackagesWithArtturi2024-03-031-0/+18
|\ \ \
| * | | lib/customization: propagate function arguments in callPackagesWith•••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; } Andrew Childs2024-02-281-0/+18
| |/ /
* | | lib/tests/release: Test lib.version in isolationRobert Hensing2024-02-261-0/+6
* | | .version: Make lib/.version source of truth•••This way we don't have to make sure they're in sync, and we remove a small step from the release process. Robert Hensing2024-02-261-9/+0
* | | lib flake: Fix version•••Manually tested with nix-repl> :lf path:lib nix-repl> lib.version Robert Hensing2024-02-261-0/+9
|/ /
* / lib/tests/test-with-nix.nix: init•••See https://github.com/NixOS/nix/pull/9900 Robert Hensing2024-02-232-54/+71
|/
* Merge pull request #284512 from hercules-ci/lib-types-unique-merge•••lib.types.unique: Check inner type deeplySilvan Mosberger2024-02-102-0/+37
|\
| * lib.types.unique: Check inner type deeply•••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. Robert Hensing2024-01-282-0/+37
* | Merge pull request #285612 from hercules-ci/doRename-condition•••lib.modules.doRename: Add condition parameterRobert Hensing2024-02-055-0/+74
|\ \
| * | lib.modules.doRename: Add condition parameter•••This is to support single-to-multi service migrations, so that the `to` (e.g. `foos.""`) isn't defined unconditionally. See test cases. Robert Hensing2024-02-025-0/+74
* | | Merge pull request #285353 from sternenseemann/nix-2.3-syntax•••treewide: fix parse errors with Nix 2.3 and related problemsSilvan Mosberger2024-02-052-0/+2
|\ \ \
| * | | lib/tests/packages-from-directory: make sure all .nix files parse•••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. sternenseemann2024-01-312-0/+2
| |/ /
* / / lib: Add optionalDrvAttr to conditionally set drv attributes.•••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. Shea Levy2024-02-021-1/+19
|/ /