summary refs log tree commit diff
path: root/lib/tests
Commit message (Collapse)AuthorAge
* lib/tests/sources.sh: initRobert Hensing2021-05-29
|
* Revert "lib/tests: Add type deprecation tests"Robert Hensing2021-05-05
| | | | This reverts commit 8b957e3b301d748e6fbbed806d82bd9d4b9d4ac4.
* lib/tests: Add type deprecation testsSilvan Mosberger2021-05-03
|
* lib/tests: Make sure the submodule type description can be evaluatedSilvan Mosberger2021-05-03
| | | | | | | | | | | | | | | | | In 2d45a62899d47c109a0b8ce4ca9d33265b8a1a37, the submodule type description was amended with the freeformType description. This causes all the modules passed to the submodule to be evaluated once on their own, without any extra definitions from the config section. This means that the specified modules need to be valid on their own, without any undeclared options. This commit adds a test that evaluates a submodules option description, which would trigger the above problem for one of the tests, if it were not fixed by this commit as well. This is done because the next commit makes option evaluation a bit more strict, which would also trigger this test failure, even though it's not related to the change at all.
* lib.systems.doubles.netbsd: expandAlyssa Ross2021-04-23
| | | | | | | These are all the architectures supported by Nixpkgs on other platforms, that are also supported by NetBSD. (So I haven't added any architectures that are new to Nixpkgs here, even though NetBSD supports some that we don't have.)
* lib/modules: better error message if an attr-set of options is expectedMaximilian Bosch2021-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently wrote some Nix code where I wrongly set a value to an option which wasn't an actual option, but an attr-set of options. The mistake I made can be demonstrated with an expression like this: { foo = { lib, pkgs, config, ... }: with lib; { options.foo.bar.baz = mkOption { type = types.str; }; config.foo.bar = 23; }; } While it wasn't too hard to find the cause of the mistake for me, it was necessary to have some practice in reading stack traces from the module system since the eval-error I got was not very helpful: error: --- TypeError --------------------------------------------------------- nix-build at: (323:25) in file: /nix/store/3nm31brdz95pj8gch5gms6xwqh0xx55c-source/lib/modules.nix 322| foldl' (acc: module: 323| acc // (mapAttrs (n: v: | ^ 324| (acc.${n} or []) ++ f module v value is an integer while a set was expected (use '--show-trace' to show detailed location information) I figured that such an error can be fairly confusing for someone who's new to NixOS, so I decided to catch this case in th `byName` function in `lib/modules.nix` by checking if the value to map through is an actual attr-set. If not, a different error will be thrown.
* Merge pull request #111345 from r-burns/ppc64-big-endianJohn Ericson2021-01-30
|\ | | | | Enable PPC64 (big-endian)
| * lib.systems: add powerpc64-linuxRyan Burns2021-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PPC64 supports two ABIs: ELF v1 and v2. ELFv1 is historically what GCC and most packages expect, but this is changing because musl outright does not work with ELFv1. So any distro which uses musl must use ELFv2. Many other platforms are moving to ELFv2 too, such as FreeBSD (as of v13) and Gentoo (as of late 2020). Since we use musl extensively, let's default to ELFv2. Nix gives us the power to specify this declaratively for the entire system, so ELFv1 is not dropped entirely. It can be specified explicitly in the target config, e.g. "powerpc64-unknown-linux-elfv1". Otherwise the default is "powerpc64-unknown-linux-elfv2". For musl, "powerpc64-unknown-linux-musl" must use elfv2 internally to function.
* | lib/attrsets: add cartesianProductOfSets functionJacek Galowicz2021-01-28
| |
* | lib/tests: More functionTo testsSilvan Mosberger2021-01-27
| |
* | lib/tests/modules: add a test for the functionTo typeBas van Dijk2021-01-24
|/ | | | (cherry picked from commit 478af112e83df806bd8a51174834d2a130fbdeb9)
* Revert "Module-builtin assertions, disabling assertions and submodule ↵Silvan Mosberger2020-12-18
| | | | assertions"
* lib/modules: Introduce _module.checks.*.checkSilvan Mosberger2020-12-17
| | | | | | | | | | | | Previously the .enable option was used to encode the condition as well, which lead to some oddness: - In order to encode an assertion, one had to invert it - To disable a check, one had to mkForce it By introducing a separate .check option this is solved because: - It can be used to encode assertions - Disabling is done separately with .enable option, whose default can be overridden without a mkForce
* lib/modules: Remove _module.checks.*.triggerPath as it's not necessarySilvan Mosberger2020-11-30
| | | | | | Previously this option was thought to be necessary to avoid infinite recursion, but it actually isn't, since the check evaluation isn't fed back into the module fixed-point.
* lib/modules: Rename _module.assertions to _module.checksSilvan Mosberger2020-11-30
|
* lib/tests: Add tests for module-builtin assertionsSilvan Mosberger2020-11-30
|
* lib/tests: Implement generalized checkConfigCodeOutErr for module testsSilvan Mosberger2020-11-30
|
* nixos/modules: Expose the internal module in the top-level documentationSilvan Mosberger2020-11-30
|
* Merge pull request #102766 from siraben/mmixJohn Ericson2020-11-14
|\ | | | | Initial implementation of cross-compilation to Knuth's MMIX
| * Initial implementation of mmix cross-compileBen Siraphob2020-11-09
| |
* | lib: Add composeManyExtensionsJoe Hermaszewski2020-11-13
|/
* lib.splitString: use builtin.splitEtienne Laurin2020-10-18
|
* lib/tests: Update for error message changesSilvan Mosberger2020-09-21
|
* lib/tests: Allow grepping for newlines in error messagesSilvan Mosberger2020-09-21
|
* Merge pull request #97133 from Infinisil/improved-toPrettySilvan Mosberger2020-09-21
|\ | | | | Improve `generators.toPretty`
| * lib/generators.toPretty: Print [] and {} compactlySilvan Mosberger2020-09-17
| |
| * lib/generators.toPretty: Switch away from δ and λSilvan Mosberger2020-09-17
| | | | | | | | | | | | | | | | - These symbols can be confusing for those not familiar with them - There's no harm in making these more obvious - Terminals may not print them correctly either Also changes the function argument printing slightly to be more obvious
| * lib/generators.toPretty: Improved string printing, handling newlinesSilvan Mosberger2020-09-17
| |
| * lib/generators.toPretty: Implement multiline printingSilvan Mosberger2020-09-17
| |
| * lib/generators.toPretty: Only quote attribute names if necessarySilvan Mosberger2020-09-17
| |
* | Merge pull request #97119 from Infinisil/types.anythingRobert Hensing2020-09-21
|\ \ | | | | | | Introduce `types.anything`
| * | lib/tests: Add tests for types.anythingSilvan Mosberger2020-09-15
| |/
* / lib/tests: Add test for freeform option docsSilvan Mosberger2020-09-04
|/
* Don't set $NIX_DB_DIREelco Dolstra2020-08-24
| | | | This variable was removed in 2016.
* Merge pull request #82743 from Infinisil/partially-typed-v2Robert Hensing2020-08-15
|\ | | | | Freeform modules
| * lib/modules: Add syntactic sugar for config._module.freeformTypeSilvan Mosberger2020-08-14
| | | | | | | | | | | | | | | | | | | | | | This introduces `freeformType` as a top-level module attribute, allowing definitions like { freeformType = ...; options = ...; config = ...; }
| * lib/modules: Fix freeform modules when there's no definitionsSilvan Mosberger2020-08-10
| |
| * lib/tests: Add tests for freeform modulesSilvan Mosberger2020-08-03
| |
* | Define a i686-genode system doubleEmery Hemingway2020-08-04
|/
* lib/*: editorconfig fixeszowoq2020-07-31
|
* Merge pull request #93568 from aaronjanse/aj-redoxJohn Ericson2020-07-22
|\ | | | | Add Redox OS as a target
| * redox: add as targetAaron Janse2020-07-21
| |
* | lib: toHex -> toHexString & toBase -> toBaseDigitsBas van Dijk2020-07-20
| | | | | | | | This makes the type of these functions more apparent from the name.
* | lib: add the toHex and toBase utility functionsBas van Dijk2020-07-20
|/ | | | | | | | | | | | | | | | | | | | | | | | `toHex` converts the given positive integer to a string of the hexadecimal representation of that integer. For example: ``` toHex 0 => "0" toHex 16 => "10" toHex 250 => "FA" ``` `toBase base i` converts the positive integer `i` to a list of it digits in the given `base`. For example: ``` toBase 10 123 => [ 1 2 3 ] toBase 2 6 => [ 1 1 0 ] toBase 16 250 => [ 15 10 ] ```
* lib/tests: Allow overriding pkgs independent of lib being testedSilvan Mosberger2020-04-25
|
* lib/maintainer-list: Implement validity checksSilvan Mosberger2020-04-13
|
* lib/tests/release.nix: Avoid importing nixpkgs into the storeSilvan Mosberger2020-04-13
| | | | Improves build time by about a factor of two on my system
* lib/tests/modules.sh: Don't depend on $PWDSilvan Mosberger2020-04-13
|
* Merge pull request #83241 from Infinisil/valid-drv-nameSilvan Mosberger2020-04-02
|\ | | | | lib/strings: Add `sanitizeDerivationName` function
| * lib/strings: Add sanitizeDerivationName functionSilvan Mosberger2020-03-30
| |