summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2021-12-17Merge pull request #148785 from pennae/more-option-doc-staticizingGraham Christensen
treewide: more defaultText for options
2021-12-16lib.systems.supported: remove aarch64-darwin from Tier 3 liststernenseemann
While it is a fact of life that aarch64-darwin is built on Hydra, it has never formally been elevated from the Tier 7 state it was originally assigned in RFC 0046. Since platform Tier status is not only descriptive, but also normative, a consensus to commit to supporting aarch64-darwin would need to be reached.
2021-12-13lib: fix flake checkzimbatm
`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
2021-12-09Merge pull request #149924 from Mic92/aarch64be-embeddedJörg Thalheim
pkgsCross.aarch64be-embedded: fix eval
2021-12-09pkgsCross.x86_64-netbsd-llvm: mark as brokenJörg Thalheim
2021-12-09pkgsCross.ppcle-embedded: fix evalJörg Thalheim
2021-12-09pkgsCross.aarch64be-embedded: fix evalJörg Thalheim
2021-12-08nixos/modules: Allow options to be coerced to a string for convenienceSilvan Mosberger
2021-12-07Merge pull request #144022 from hercules-ci/lib-modules-optimize-unmatchedDefnsSilvan Mosberger
lib/modules: Short-circuit unmatchedDefns when configs is empty
2021-12-07Merge pull request #141856 from ShamrockLee/lib-spdx-licenseSilvan Mosberger
lib/meta: add getLicenseFromSpdxId function (resumed)
2021-12-02lib/modules: Deprecate args and checkRobert Hensing
2021-12-02lib/modules: Pass legacy args argument along through extendModulesRobert Hensing
2021-12-02lib/meta: add getLicenseFromSpdxId functionShamrock Lee
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
2021-11-26lib/tests: Use standard test syntaxVictor Engmark
For consistency.
2021-11-26lib/tests: Anchor config output regexesVictor Engmark
Strengthens the tests by making sure the whole line is matched.
2021-11-26lib/tests: Set hardening pragmasVictor Engmark
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.
2021-11-26lib/tests: Don't return non-zero values from checksVictor Engmark
The exit codes aren't used for anything.
2021-11-26lib/tests: Avoid assigning an array to a stringVictor Engmark
As per <https://github.com/koalaman/shellcheck/wiki/SC2124>.
2021-11-26lib/tests: Remove redundant semicolonsVictor Engmark
2021-11-26lib/tests: Clarify assignmentVictor Engmark
The extra equal sign was confusing, and doesn't seem to be relevant.
2021-11-26lib/tests: Use correct shebang lineVictor Engmark
The script uses plenty of non-POSIX features, such as referencing `$BASH_SOURCE`.
2021-11-26lib/tests: Quote variable referencesVictor Engmark
2021-11-26lib/tests: `export` separately from assignmentVictor Engmark
Avoids hiding the exit code from the assignment. See <https://github.com/koalaman/shellcheck/wiki/SC2155>.
2021-11-22add release notes for 22.05 and update codenameTimothy DeHerrera
2021-11-22modules: Add moduleType to module argumentsRobert Hensing
2021-11-22modules: Document that extendModules is also a module argumentRobert Hensing
2021-11-15lib.modules: add mkDerivedConfigTaeer Bar-Yam
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`.
2021-11-10lib/systems: add x86_64-darwin hostPlatformJonathan Ringer
2021-11-09lib/tests/sources: update to Nix 2.4 cli syntaxBernardo Meurer
2021-11-09lib/tests/modules.sh: update to Nix 2.4 syntaxBernardo Meurer
2021-11-03lib/modules: Use strict fold' as recursiveUpdate is also strictRobert Hensing
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
2021-11-03lib/modules: Fix import* commentsRobert Hensing
Very confusing otherwise.
2021-11-03lib/modules: Remove a lib.flipRobert Hensing
In hot code, the overhead (envs, applies) can matter.
2021-11-03lib/tests/modules: Test non-strictness some moreRobert Hensing
Doesn't seem to have been a problem actually, but now it won't regress.
2021-11-03lib/modules: Short-circuit unmatchedDefns earlierRobert Hensing
2021-11-02lib: fix escapeXML example in documentationRobert Helgesson
The previous example output was forgotten copy-paste from some other function.
2021-11-02Merge pull request #144072 from ↵Ben Siraphob
polykernel/lib-lists-mutuallyexclusive-optimization
2021-11-01lib/lists: mutuallyExclusive function optimizationpolykernel
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).
2021-11-01modules: Update evalModules docRobert Hensing
2021-11-01modules: Add visible = "shallow" to hide only sub-optionsRobert Hensing
2021-11-01modules: Add extendModules to module argsRobert Hensing
2021-11-01lib.evalModules: Add extendModules and type to resultRobert Hensing
Allows the simultaneous construction of top-level invocations and submodule types. This helps structure configuration systems integration code.
2021-10-31lib/modules: Short-circuit unmatchedDefns when configs is emptyRobert Hensing
2021-10-28Merge pull request #139284 from r-burns/powernv-kernel-configRyan Burns
lib/systems: update powernv kernel config
2021-10-21Merge pull request #141789 from pennae/eval-optSilvan Mosberger
lib: make extendDerivation lighter on eval
2021-10-15licenses: add CAPECMarkus S. Wamser
2021-10-15lib: make extendDerivation lighter on evalpennae
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.
2021-10-13Merge pull request #140763 from hercules-ci/abort-on-warnRobert Hensing
lib.warn: Add NIX_ABORT_ON_WARN for call traces
2021-10-13lib.warn: Add NIX_ABORT_ON_WARN for call tracesRobert Hensing
2021-10-06lib.systems.supported.tier3: add aarch64-darwinzimbatm
aarch64-darwin is getting built by hydra