summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2023-01-27maintainers: clarify what fields are requiredNaïm Favier
2023-01-27maintainers: disallow `noreply.github.com` emailsNaïm Favier
2023-01-27maintainers: make `email` optionalNaïm Favier
Not giving an email address is fine as long as the maintainer is reachable through other means, such as GitHub or Matrix.
2023-01-25Merge pull request #212189 from ↵Robert Hensing
amjoseph-nixpkgs/pr/lib/mapAttrsRecursive/comment attrsets: clarify that mapAttrs maps over *leaf* attrs
2023-01-25Update lib/attrsets.nixAdam Joseph
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-01-24Merge pull request #212408 from raboof/imapsync-fix-licensePascal Wittmann
imapsync: fix license
2023-01-24licenses: add NLPLArnout Engelen
2023-01-23Merge pull request #209769 from LoveIsGrief/simple-dlna-browserSandro
2023-01-22attrsets: clarify that mapAttrs maps over *leaf* attrsAdam Joseph
2023-01-22lib/meta.nix: platformMatch: allow predicate functionsAdam Joseph
2023-01-20Merge pull request #210976 from clhodapp/fix/extensible-setsRobert Hensing
lib: make extender available on self-references
2023-01-19Merge pull request #211622 from alyssais/valgrind-platformsJohn Ericson
valgrind: make meta.platforms more accurate
2023-01-19lib.platforms.s390x: initAlyssa Ross
2023-01-19lib.platforms.power: initAlyssa Ross
2023-01-19lib.platforms.armv7: initAlyssa Ross
2023-01-18lib/tests/release.nix: Make nix a parameter + strictDepsRobert Hensing
This makes bisecting nix a bit easier. Example reproducer, invoked from nix directory: ```bash nix-build ../nixpkgs/lib/tests/release.nix --arg nix '(builtins.getFlake "git+file://${toString ./.}").packages.x86_64-linux.default' ```
2023-01-15lib: make extender available on self-referencesChris Hodapp
2023-01-13Merge pull request #184521 from dramforever/riscv-isefiNick Cao
lib/systems/inspect.nix: Add riscv to isEfi
2023-01-11check-meta(hasUnsupportedPlatform): use lib.meta.availableOnAdam Joseph
`hasUnsupportedPlatform` was not updated with #37395, so it does not understand attrsets in `meta.[bad]platforms`. In particular, attrsets in `meta.badPlatforms` will "fail open" and be ignored. Let's use `lib.meta.availableOn` instead of duplicating its logic. Thanks to @alyssais for [noticing][1]. [1][https://github.com/NixOS/nixpkgs/pull/194148#discussion_r990817610] Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2023-01-11lib/meta(availableOn): handle missing meta and empty meta.platformAdam Joseph
2023-01-10lib/licenses add Fair licenseLoveIsGrief
2023-01-10Merge pull request #209974 from amjoseph-nixpkgs/pr/close/209952Artturi
2023-01-10lib/path/tests: Fix property tests when "-n" is generatedSilvan Mosberger
When "-n" is generated by the property tests, it causes `echo` to not output the string since it's interpreted as an option. Apparently there's no good way to print "-n" with `echo` [1], so switching to `printf` instead [1]: https://unix.stackexchange.com/questions/85846/how-can-i-print-n-with-echo
2023-01-09add mipsisa{32,64}r6[el], closes 209952Adam Joseph
2023-01-08lib/modules: make `mkAliasOptionModule` emit DocBookNaïm Favier
Follow-up to https://github.com/NixOS/nixpkgs/pull/208407 Removing `mdDoc` isn't enough, we need to emit actual DocBook.
2023-01-05Merge pull request #208674 from YoshiRulz/yoshi-lib-docsSilvan Mosberger
lib: Fix mismatched quotes in `lib.*` doc comments
2023-01-05lib/modules: hide _module.args docspennae
unfortunately we can't unconditionally make this text markdown without impacting downstream users of docs generation (as noted in #175586). hide it entirely until the transition is complete.
2023-01-05modules: add mkPackageOptionMDpennae
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05modules: add mkAliasOptionModuleMDpennae
mkAliasOptionModule should not default to mdDoc descriptions because that can break out-of-tree users of documentation infrastructure. add an explicitly-MD variant for now, to be removed some time after the MD transition is complete.
2023-01-03Merge pull request #205190 from NixOS/lib.path.relativeNormaliseRobert Hensing
lib.path.subpath.{isValid,normalise}: init
2023-01-03lib.path.subpath.normalise: add property testsSilvan Mosberger
2023-01-03lib.path.subpath.normalise: initSilvan Mosberger
2023-01-03lib.path.subpath.isValid: initSilvan Mosberger
The first path library function
2023-01-03lib.path: init README.md documentSilvan Mosberger
Adds initial work towards a `lib.path` library Originally proposed in https://github.com/NixOS/nixpkgs/pull/200718, but has since gone through some revisions Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2023-01-03Merge pull request #208698 from amjoseph-nixpkgs/pr/nss/ilp32Martin Weinelt
2023-01-01lib/systems/inspect.nix: add isILP32 predicateAdam Joseph
I've run into a few packages that need an extra flag on platforms where `int` has more bits than `void*` does. I know of three such platforms: * [aarch64ilp32], used on both Linux and also on the [Apple Watch] * [x32], the x86 ILP32 ABI * [mips64n32], used on [Longsoon] and Cavium Octeon routers. This PR introduces a predicate so the package flags can be added in a generic way. [Apple Watch]: https://gist.github.com/woachk/943828f37c14563a607a26116435bf27#watch [mips64n32]: https://en.wikipedia.org/wiki/MIPS_architecture#Calling_conventions [Longsoon]: https://en.wikipedia.org/wiki/Loongson [x32]: https://en.wikipedia.org/wiki/X32_ABI
2023-01-01lib/systems: fix uname.processor for powerpc{32,64}, mips64Adam Joseph
Cross-compilation of anything downstream of gtk3 requires qemu (due to gobject-introspection) with --target-list=*-linux-user. Without this commit, those qemu builds will fail on a powerpc64le host due to qemu being configured with --cpu=powerpc64le instead of --cpu=ppc64le. Unfortunately the build failure message from qemu in this situation is extremely cryptic. The root cause turns out not to be the qemu expression, but rather the fact that on powerpc64le hostPlatform.uname.processor returns the gnu-name (powerpc64le) for the cpu instead of the linux-name (ppc64le) for the cpu. uname.processor on mips64el also needs adjustment -- the Linux-name is "mips64" for both big and little endian (unlike powerpc64, where the Linux-name includes a "le" suffix): ``` nix@oak:/tmp$ uname -m; lscpu | head -n2 mips64 Architecture: mips64 Byte Order: Little Endian ``` uname.processor on powerpc32 has also been adjusted.
2023-01-02lib: Fix mismatched quotes in `lib.*` doc commentsYoshiRulz
caused problems for automated rich text generation such as https://teu5us.github.io/nix-lib.html#customisation-functions
2023-01-01lib/trival: Bump oldestSupportedRelease to 2211Martin Weinelt
2023-01-01stdenv/check-meta: do deep type checksNaïm Favier
Use a wrapper around `mergeDefinitions` to type-check values deeply, so that e.g. `maintainers = [ 42 ];` is an error.
2023-01-01lib/customisation.overrideDerivation: propagate evaluation conditionNaïm Favier
The new derivation should evaluate only if the old derivation does. Sadly this means that the old derivation cannot depend on the new one any more, which was used by xorgserver on Darwin. But this is not a problem as `overrideAttrs` can (and should) usually be used instead. This change allowed catching an invalid `meta.platforms` in the linux_rpi kernels, which use `overrideDerivation`.
2022-12-31lib: Add isStringLikeRobert Hensing
2022-12-31lib.isStringLike: Remove use of listRobert Hensing
In the current implementation of Nix, this list would be allocated over and over. Iirc pennae tried to optimize static list allocation, but gained no significant performance improvement.
2022-12-31lib: Add isPathRobert Hensing
Available since Nix 2.3, which is the Nixpkgs minimum version. Thanks zimbatm!
2022-12-31lib.strings.isConvertibleWithToString: Refactor to reuse isStringLikeRobert Hensing
2022-12-31lib.strings: isMoreCoercibleString -> isConvertibleWithToStringRobert Hensing
Yes, this function name is inconveniently long, but it is important for the name to explicitly reference the function and not be mistaken for the implicit string conversions, which only happen for a smaller set of values.
2022-12-31lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing
2022-12-31lib.types.path: Do not allow lists of stringsRobert Hensing
2022-12-31treewide: isCoercibleToString -> isMoreCoercibleToStringRobert Hensing
No change in behavior.
2022-12-31lib.strings: Rename isCoercibleToString -> isMoreCoercibleToStringRobert Hensing