summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* lib: fix flake checkzimbatm2021-12-13
| | | | | | | | | | | | | | | | | | | | `builtins.currentSystem` is not available in pure eval. For this particular test, we don't really care since it's all about generating .drv files. Fixes the following error: $ nix flake check warning: unknown flake output 'lib' error: attribute 'currentSystem' missing at /nix/store/8wvnlbjxlr90kq2qa6d9zjpj8rqkilr5-source/lib/tests/misc.nix:499:73: 498| let 499| deriv = derivation { name = "test"; builder = "/bin/sh"; system = builtins.currentSystem; }; | ^ 500| in { (use '--show-trace' to show detailed location informat
* Merge pull request #149924 from Mic92/aarch64be-embeddedJörg Thalheim2021-12-09
|\ | | | | pkgsCross.aarch64be-embedded: fix eval
| * pkgsCross.ppcle-embedded: fix evalJörg Thalheim2021-12-09
| |
| * pkgsCross.aarch64be-embedded: fix evalJörg Thalheim2021-12-09
| |
* | pkgsCross.x86_64-netbsd-llvm: mark as brokenJörg Thalheim2021-12-09
|/
* Merge pull request #144022 from hercules-ci/lib-modules-optimize-unmatchedDefnsSilvan Mosberger2021-12-07
|\ | | | | lib/modules: Short-circuit unmatchedDefns when configs is empty
| * lib/modules: Use strict fold' as recursiveUpdate is also strictRobert Hensing2021-11-03
| | | | | | | | | | | | | | | | | | | | | | recursiveUpdate does not produce an attrset until it has evaluated both its arguments to weak head normal form. nix-repl> lib.recursiveUpdate (throw "a") (throw "b") error: b nix-repl> lib.recursiveUpdate (throw "a") {} error: a
| * lib/modules: Fix import* commentsRobert Hensing2021-11-03
| | | | | | | | Very confusing otherwise.
| * lib/modules: Remove a lib.flipRobert Hensing2021-11-03
| | | | | | | | In hot code, the overhead (envs, applies) can matter.
| * lib/tests/modules: Test non-strictness some moreRobert Hensing2021-11-03
| | | | | | | | | | Doesn't seem to have been a problem actually, but now it won't regress.
| * lib/modules: Short-circuit unmatchedDefns earlierRobert Hensing2021-11-03
| |
| * lib/modules: Short-circuit unmatchedDefns when configs is emptyRobert Hensing2021-10-31
| |
* | Merge pull request #141856 from ShamrockLee/lib-spdx-licenseSilvan Mosberger2021-12-07
|\ \ | | | | | | lib/meta: add getLicenseFromSpdxId function (resumed)
| * | lib/meta: add getLicenseFromSpdxId functionShamrock Lee2021-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move function spdxLicense, internally used in yarn2nix to lib/meta.nix, and rename to getLicenseFromSpdxId A similar function is implemented in poetry2nix, but the one originally in yarn2nix seems beter. since it falls back to an license-like attrset for mismatched case instead of a plain string
* | | lib/modules: Deprecate args and checkRobert Hensing2021-12-02
| | |
* | | lib/modules: Pass legacy args argument along through extendModulesRobert Hensing2021-12-02
| | |
* | | lib/tests: Use standard test syntaxVictor Engmark2021-11-26
| | | | | | | | | | | | For consistency.
* | | lib/tests: Anchor config output regexesVictor Engmark2021-11-26
| | | | | | | | | | | | Strengthens the tests by making sure the whole line is matched.
* | | lib/tests: Set hardening pragmasVictor Engmark2021-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes any programming errors more likely to show up early. Non-obvious changes because of this: - Ignore the `evalConfig` result in `reportFailure`; we're not checking it at that point. - Pre-increment `$fail` and `$pass` to make sure the arithmetic doesn't result in a zero, which would result in a non-zero exit code for the expression.
* | | lib/tests: Don't return non-zero values from checksVictor Engmark2021-11-26
| | | | | | | | | | | | The exit codes aren't used for anything.
* | | lib/tests: Avoid assigning an array to a stringVictor Engmark2021-11-26
| | | | | | | | | | | | As per <https://github.com/koalaman/shellcheck/wiki/SC2124>.
* | | lib/tests: Remove redundant semicolonsVictor Engmark2021-11-26
| | |
* | | lib/tests: Clarify assignmentVictor Engmark2021-11-26
| | | | | | | | | | | | The extra equal sign was confusing, and doesn't seem to be relevant.
* | | lib/tests: Use correct shebang lineVictor Engmark2021-11-26
| | | | | | | | | | | | | | | The script uses plenty of non-POSIX features, such as referencing `$BASH_SOURCE`.
* | | lib/tests: Quote variable referencesVictor Engmark2021-11-26
| | |
* | | lib/tests: `export` separately from assignmentVictor Engmark2021-11-26
| | | | | | | | | | | | | | | Avoids hiding the exit code from the assignment. See <https://github.com/koalaman/shellcheck/wiki/SC2155>.
* | | add release notes for 22.05 and update codenameTimothy DeHerrera2021-11-22
| | |
* | | modules: Add moduleType to module argumentsRobert Hensing2021-11-22
| | |
* | | modules: Document that extendModules is also a module argumentRobert Hensing2021-11-22
|/ /
* | lib.modules: add mkDerivedConfigTaeer Bar-Yam2021-11-15
| | | | | | | | | | | | | | | | | | | | | | mkDerivedConfig : Option a -> (a -> Definition b) -> Definition b Create config definitions with the same priority as the definition of another option. This should be used for option definitions where one option sets the value of another as a convenience. For instance a config file could be set with a `text` or `source` option, where text translates to a `source` value using `mkDerivedConfig options.text (pkgs.writeText "filename.conf")`. It takes care of setting the right priority using `mkOverride`.
* | lib/systems: add x86_64-darwin hostPlatformJonathan Ringer2021-11-10
| |
* | lib/tests/sources: update to Nix 2.4 cli syntaxBernardo Meurer2021-11-09
| |
* | lib/tests/modules.sh: update to Nix 2.4 syntaxBernardo Meurer2021-11-09
| |
* | lib: fix escapeXML example in documentationRobert Helgesson2021-11-02
| | | | | | | | | | The previous example output was forgotten copy-paste from some other function.
* | Merge pull request #144072 from ↵Ben Siraphob2021-11-02
|\ \ | | | | | | | | | polykernel/lib-lists-mutuallyexclusive-optimization
| * | lib/lists: mutuallyExclusive function optimizationpolykernel2021-11-01
| |/ | | | | | | | | | | | | | | | | | | | | The current implementation of `mutuallyExclusive` builds a new list with length subtracted by one on every recursive call which is expensive. When b is empty, the function still traverses a in its entirety before returning a result. The new implementation uses `any` to check if each element of list b is in list a using `elem`. This maintains short circuiting when list a or b is empty and has a worst case time complexity of O(nm).
* | modules: Update evalModules docRobert Hensing2021-11-01
| |
* | modules: Add visible = "shallow" to hide only sub-optionsRobert Hensing2021-11-01
| |
* | modules: Add extendModules to module argsRobert Hensing2021-11-01
| |
* | lib.evalModules: Add extendModules and type to resultRobert Hensing2021-11-01
|/ | | | | | | Allows the simultaneous construction of top-level invocations and submodule types. This helps structure configuration systems integration code.
* Merge pull request #139284 from r-burns/powernv-kernel-configRyan Burns2021-10-28
|\ | | | | lib/systems: update powernv kernel config
| * lib/systems: update powernv kernel configRyan Burns2021-09-28
| | | | | | | | | | | | | | | | PowerNV was looking for a nonexisting zImage file. Remove unnecessary .file / .installTarget. Also add config options needed for default minimal NixOS config and QEMU VirtIO/VirtFS devices.
* | Merge pull request #141789 from pennae/eval-optSilvan Mosberger2021-10-21
|\ \ | | | | | | lib: make extendDerivation lighter on eval
| * | lib: make extendDerivation lighter on evalpennae2021-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | the fix to extendDerivation in #140051 unwittingly worsened eval performance by quite a bit. set elements alone needed over 1GB extra after the change, which seems disproportionate to how small it was. if we flip the logic used to determine which outputs to install around and keep a "this one exactly" flag in the specific outputs instead of a "all of them" in the root we can avoid most of that cost.
* | | licenses: add CAPECMarkus S. Wamser2021-10-15
|/ /
* | Merge pull request #140763 from hercules-ci/abort-on-warnRobert Hensing2021-10-13
|\ \ | | | | | | lib.warn: Add NIX_ABORT_ON_WARN for call traces
| * | lib.warn: Add NIX_ABORT_ON_WARN for call tracesRobert Hensing2021-10-13
| | |
* | | lib.systems.supported.tier3: add aarch64-darwinzimbatm2021-10-06
|/ / | | | | | | aarch64-darwin is getting built by hydra
* | Merge pull request #140284 from Infinisil/types-anything-lambdasSilvan Mosberger2021-10-05
|\ \ | | | | | | lib/types: Make types.anything merge functions
| * | lib/types: Make types.anything merge functionsSilvan Mosberger2021-10-02
| |/ | | | | | | | | Previously it would give an error if there were multiple function definitions.