about summary refs log tree commit diff
path: root/lib/tests
AgeCommit message (Collapse)AuthorFilesLines
2022-10-01Merge pull request #193132 from figsoda/clean-upfigsoda1-1/+0
treewide: clean up
2022-09-26lib/tests/maintainers.nix: remove unused bindingfigsoda1-1/+0
2022-09-21lib/modules: Fix meta duplication in shorthand syntaxRobert Hensing2-0/+22
2022-09-21lib: Add lazyDerivationRobert Hensing1-0/+53
2022-09-17lib.types: Add parentheses where description is ambiguousRobert Hensing1-0/+53
2022-08-31Merge pull request #188289 from erikarvstedt/fix-disabled-modules-abs-pathsRobert Hensing2-0/+6
lib.modules: support strings with absolute paths in `disabledModules`
2022-08-31lib.modules: support strings with absolute paths in `disabledModules`Erik Arvstedt2-0/+6
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.
2022-08-25lib/systems: add MicroBlaze architecturesMinijackson1-1/+1
2022-06-20teams/maintainers list: show instructions for validating the contentsGraham Christensen1-2/+2
2022-06-20maintainer teams: check them in lib testsGraham Christensen2-0/+54
2022-06-20maintainer lib test: extract maintainer moduleGraham Christensen2-31/+32
2022-06-20maintainers: remove longkeyidGraham Christensen1-1/+0
see https://dkg.fifthhorseman.net/blog/openpgp-key-ids-are-not-useful.html
2022-06-14lib/modules: Throw earlier when module function does not return attrsRobert Hensing2-0/+21
`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.
2022-06-14lib.deferredModule: Make it properly singularRobert Hensing1-1/+1
2022-06-14lib.types.deferredModule: Allow path-typed module referencesRobert Hensing2-3/+4
2022-06-14lib.types.deferredModule: Improve reported locationRobert Hensing1-1/+1
2022-06-14lib/test/modules.sh: Test deferredModule error location fileRobert Hensing2-2/+11
2022-06-14lib.types: Add deferredModuleRobert Hensing2-0/+57
2022-06-14lib/tests: Add submodule file propagation testSilvan Mosberger2-0/+25
2022-05-23Merge pull request #168374 from Ma27/special-attrs-in-with-recursionSilvan Mosberger1-0/+15
lib/generators: withRecursion: don't break attr-sets with special attrs
2022-05-17Merge pull request #172813 from hercules-ci/functionTo-properlyRobert Hensing2-0/+63
`lib.types.functionTo` type merging and docs
2022-05-16Merge pull request #170561 from klemensn/types-descriptionSilvan Mosberger1-1/+1
lib/types: Drop misleading plural from type descriptions
2022-05-15Revert "lib: init flakes.nix"adisbladis3-23/+0
This reverts commit PR #167947. Flakes aren't standardised and the `lib` namespace shouldn't be polluted with utilities that serve only experimental uses.
2022-05-13lib/tests/modules: Test functionTo submodule merging tooRobert Hensing2-8/+11
2022-05-13lib.types.functionTo: Support type mergingRobert Hensing2-0/+60
2022-05-07lib/strings/toShellVars: handle derivations as stringsNaïm Favier1-0/+12
2022-05-02lib/tests/modules.sh: Fix for singular type descriptionsRobert Hensing1-1/+1
2022-05-02Merge pull request #170090 from danth/has-infix-toStringRobert Hensing1-0/+30
lib/strings: call toString within hasInfix
2022-05-02lib/tests: add tests for hasInfixDaniel Thwaites1-0/+30
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2022-05-01Merge pull request #167947 from MatthewCroughan/mc/callLocklessFlakeArtturi3-0/+22
lib: add callLocklessFlake
2022-04-28lib.systems: add riscv{32,64} sets and filtersAlyssa Ross1-0/+2
For other platforms like Intel and ARM, we can do e.g. lib.platforms.aarch64 to get only the 64-bit ARM platorms, but until now there were no equivalents for RISC-V.
2022-04-28lib/tests: add RISC-V testAlyssa Ross1-0/+1
2022-04-27lib/strings: add toShellVarsNaïm Favier1-0/+20
A straightforward piece of plumbing to safely inject Nix variables into shell scripts: '' ${lib.toShellVars { inherit foo bar; }} cmd "$foo" --bar "$bar" ''
2022-04-24lib.types.submoduleWith: Avoid _key collisions after extendModulesRobert Hensing2-1/+46
2022-04-12lib/tests: evaluate value from subflake with callLocklessFlakematthewcroughan3-8/+8
2022-04-12lib/tests: use subflake to test callLocklessFlakematthewcroughan3-3/+16
2022-04-12lib/tests: add test for callLocklessFlakematthewcroughan1-0/+9
2022-04-12lib/generators: withRecursion: don't break attr-sets with special attrsMaximilian Bosch1-0/+15
Closes #168327 The issue reported there can be demonstrated with the following expression: → nix-instantiate --eval -E "with import ./. {}; pkgs.lib.options.showDefs [ { file = \"foo\"; value = pkgs.rust.packages.stable.buildRustPackages; } ]" error: attempt to call something which is not a function but a string at /home/ma27/Projects/nixpkgs/lib/trivial.nix:442:35: 441| isFunction = f: builtins.isFunction f || 442| (f ? __functor && isFunction (f.__functor f)); | ^ 443| Basically, if a `__functor` is in an attribute-set at depth-limit, `__functor` will be set to `"<unevaluated>"`. This however breaks `lib.isFunction` which checks for a `__functor` by invoking `__functor` with `f` itself. The same issue - "magic" attributes being shadowed by `withRecursion` - also applies to others such as `__pretty`/`__functionArgs`/`__toString`. Since these attributes have a low-risk of causing a stack overflow (because these are flat attr-sets or even functions), ignoring them in `withRecursion` seems like a valid solution.
2022-04-06Merge pull request #164088 from ↵Silvan Mosberger1-0/+60
Profpatsch/lib.generators-add-toINIWithGlobalSection lib.generators: add toINIWithGlobalSection
2022-04-05Merge pull request #165540 from Infinisil/module-args-docsRobert Hensing1-1/+1
lib/modules: Document `_module.args`
2022-04-05Merge pull request #166383 from hercules-ci/always-sanitize-derivation-nameRobert Hensing1-0/+5
Always sanitize derivation name
2022-04-05lib/modules: Document _module.argsSilvan Mosberger1-1/+1
Documents the _module.args option, motivated by many usages in Flakes, especially with the deprecation of extraArgs (https://github.com/NixOS/nixpkgs/commit/78ada833615d241ed76463aa5a024b614150eb4d) The documentation rendering for this option had to be handled a bit specially, since it's not declared in nixos/modules like all the other NixOS options. Co-Authored-By: pennae <github@quasiparticle.net> Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2022-04-01lib/tests: Add tests for levenshtein functionsSilvan Mosberger1-0/+152
2022-03-31lib.sanitizeDerivationName: Test with unicodeRobert Hensing1-0/+5
2022-03-19Merge pull request #147077 from Infinisil/updateAttrPathsRobert Hensing1-0/+152
Introduce `lib.updateManyAttrsByPath`
2022-03-18lib.attrsets: Introduce updateManyAttrsByPathSilvan Mosberger1-0/+114
2022-03-18lib.lists: Use builtins.groupBy for lib.groupBySilvan Mosberger1-1/+17
builtins.groupBy is much more performant. It was introduced in https://github.com/NixOS/nix/pull/5715
2022-03-18lib.attrsets: Introduce showAttrPathSilvan Mosberger1-0/+22
2022-03-17Merge pull request #161158 from a-m-joseph/mips64el-support-first-stepsJohn Ericson1-2/+2
mips64el support
2022-03-16Merge pull request #156533 from ↵Silvan Mosberger8-0/+87
hercules-ci/issue-146882-transparent-submodule-options lib.modules: Let module declare options directly in bare submodule