about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2023-01-20Merge pull request #210976 from clhodapp/fix/extensible-setsRobert Hensing1-2/+2
lib: make extender available on self-references
2023-01-19Merge pull request #211622 from alyssais/valgrind-platformsJohn Ericson3-0/+10
valgrind: make meta.platforms more accurate
2023-01-19lib.platforms.s390x: initAlyssa Ross3-0/+3
2023-01-19lib.platforms.power: initAlyssa Ross2-0/+2
2023-01-19lib.platforms.armv7: initAlyssa Ross3-0/+5
2023-01-18lib/tests/release.nix: Make nix a parameter + strictDepsRobert Hensing1-3/+7
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 Hodapp1-2/+2
2023-01-13Merge pull request #184521 from dramforever/riscv-isefiNick Cao1-1/+1
lib/systems/inspect.nix: Add riscv to isEfi
2023-01-11check-meta(hasUnsupportedPlatform): use lib.meta.availableOnAdam Joseph1-3/+1
`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 Joseph1-2/+5
2023-01-10Merge pull request #209974 from amjoseph-nixpkgs/pr/close/209952Artturi1-4/+8
2023-01-10lib/path/tests: Fix property tests when "-n" is generatedSilvan Mosberger1-1/+1
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 Joseph1-4/+8
2023-01-08lib/modules: make `mkAliasOptionModule` emit DocBookNaïm Favier1-3/+5
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 Mosberger5-26/+26
lib: Fix mismatched quotes in `lib.*` doc comments
2023-01-05lib/modules: hide _module.args docspennae1-0/+5
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 mkPackageOptionMDpennae2-2/+7
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05modules: add mkAliasOptionModuleMDpennae2-3/+13
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 Hensing9-1/+881
lib.path.subpath.{isValid,normalise}: init
2023-01-03lib.path.subpath.normalise: add property testsSilvan Mosberger4-0/+310
2023-01-03lib.path.subpath.normalise: initSilvan Mosberger2-0/+192
2023-01-03lib.path.subpath.isValid: initSilvan Mosberger5-1/+183
The first path library function
2023-01-03lib.path: init README.md documentSilvan Mosberger1-0/+196
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 Weinelt1-0/+1
2023-01-01lib/systems/inspect.nix: add isILP32 predicateAdam Joseph1-0/+1
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 Joseph1-7/+9
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 commentsYoshiRulz5-26/+26
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 Weinelt1-1/+1
2023-01-01stdenv/check-meta: do deep type checksNaïm Favier1-2/+4
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 Favier1-1/+9
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 Hensing1-2/+4
2022-12-31lib.isStringLike: Remove use of listRobert Hensing1-1/+3
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 Hensing1-1/+1
Available since Nix 2.3, which is the Nixpkgs minimum version. Thanks zimbatm!
2022-12-31lib.strings.isConvertibleWithToString: Refactor to reuse isStringLikeRobert Hensing1-4/+3
2022-12-31lib.strings: isMoreCoercibleString -> isConvertibleWithToStringRobert Hensing1-5/+6
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 Hensing2-10/+10
2022-12-31lib.types.path: Do not allow lists of stringsRobert Hensing1-2/+1
2022-12-31treewide: isCoercibleToString -> isMoreCoercibleToStringRobert Hensing2-3/+3
No change in behavior.
2022-12-31lib.strings: Rename isCoercibleToString -> isMoreCoercibleToStringRobert Hensing1-2/+11
2022-12-31lib.types.anything: Use isSimpleCoercibleToStringRobert Hensing1-1/+2
Expecting no change in behavior.
2022-12-31lib.strings.toShellVar: Use isSimpleCoercibleStringRobert Hensing1-1/+1
Expecting no change in behavior.
2022-12-31lib.strings.isStorePath: Use isSimpleCoercibleToStringRobert Hensing1-1/+1
Expecting no change in behavior.
2022-12-31lib.strings: Add isSimpleCoercibleToStringRobert Hensing1-0/+11
2022-12-30Merge pull request #207453 from p-h/ulogdRyan Lahfa1-0/+6
ulogd: init at 2.0.8
2022-12-29lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing1-1/+1
2022-12-29Revert "lib/types: remove loaOf"Robert Hensing1-0/+9
This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users.
2022-12-28linuxdoc-tools: init at 0.9.82Philippe Hürlimann1-0/+6
Heavily based on original work by xvuko Co-authored-by: xvuko <nix@vuko.pl>
2022-12-27Merge pull request #207095 from ncfavier/linux-custom-kernelNaïm Favier2-0/+30
2022-12-25Merge pull request #206809 from SuperSandro2000/loaOfSandro1-9/+0
2022-12-24attrsets: fix and add some doc typeshsjobeki2-27/+38