summaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Expand)AuthorAgeFilesLines
* check-meta(hasUnsupportedPlatform): use lib.meta.availableOn•••`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> Adam Joseph2023-01-111-3/+1
* lib/meta(availableOn): handle missing meta and empty meta.platformAdam Joseph2023-01-111-2/+5
* Merge pull request #209974 from amjoseph-nixpkgs/pr/close/209952Artturi2023-01-101-4/+8
|\
| * add mipsisa{32,64}r6[el], closes 209952Adam Joseph2023-01-091-4/+8
* | lib/path/tests: Fix property tests when "-n" is generated•••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 Silvan Mosberger2023-01-101-1/+1
|/
* lib/modules: make `mkAliasOptionModule` emit DocBook•••Follow-up to https://github.com/NixOS/nixpkgs/pull/208407 Removing `mdDoc` isn't enough, we need to emit actual DocBook. Naïm Favier2023-01-081-3/+5
* Merge pull request #208674 from YoshiRulz/yoshi-lib-docs•••lib: Fix mismatched quotes in `lib.*` doc commentsSilvan Mosberger2023-01-055-26/+26
|\
| * lib: Fix mismatched quotes in `lib.*` doc comments•••caused problems for automated rich text generation such as https://teu5us.github.io/nix-lib.html#customisation-functions YoshiRulz2023-01-025-26/+26
* | lib/modules: hide _module.args docs•••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. pennae2023-01-051-0/+5
* | modules: add mkPackageOptionMD•••another transitional option factory, like mkAliasOptionModuleMD. pennae2023-01-052-2/+7
* | modules: add mkAliasOptionModuleMD•••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. pennae2023-01-052-3/+13
* | Merge pull request #205190 from NixOS/lib.path.relativeNormalise•••lib.path.subpath.{isValid,normalise}: initRobert Hensing2023-01-039-1/+881
|\ \
| * | lib.path.subpath.normalise: add property testsSilvan Mosberger2023-01-034-0/+310
| * | lib.path.subpath.normalise: initSilvan Mosberger2023-01-032-0/+192
| * | lib.path.subpath.isValid: init•••The first path library function Silvan Mosberger2023-01-035-1/+183
| * | lib.path: init README.md document•••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> Silvan Mosberger2023-01-031-0/+196
* | | Merge pull request #208698 from amjoseph-nixpkgs/pr/nss/ilp32Martin Weinelt2023-01-031-0/+1
|\ \ \
| * | | lib/systems/inspect.nix: add isILP32 predicate•••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 Adam Joseph2023-01-011-0/+1
| | |/ | |/|
* / | lib/systems: fix uname.processor for powerpc{32,64}, mips64•••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. Adam Joseph2023-01-011-7/+9
|/ /
* | lib/trival: Bump oldestSupportedRelease to 2211Martin Weinelt2023-01-011-1/+1
* | stdenv/check-meta: do deep type checks•••Use a wrapper around `mergeDefinitions` to type-check values deeply, so that e.g. `maintainers = [ 42 ];` is an error. Naïm Favier2023-01-011-2/+4
* | lib/customisation.overrideDerivation: propagate evaluation condition•••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`. Naïm Favier2023-01-011-1/+9
* | lib: Add isStringLikeRobert Hensing2022-12-311-2/+4
* | lib.isStringLike: Remove use of list•••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. Robert Hensing2022-12-311-1/+3
* | lib: Add isPath•••Available since Nix 2.3, which is the Nixpkgs minimum version. Thanks zimbatm! Robert Hensing2022-12-311-1/+1
* | lib.strings.isConvertibleWithToString: Refactor to reuse isStringLikeRobert Hensing2022-12-311-4/+3
* | lib.strings: isMoreCoercibleString -> isConvertibleWithToString•••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. Robert Hensing2022-12-311-5/+6
* | lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing2022-12-312-10/+10
* | lib.types.path: Do not allow lists of stringsRobert Hensing2022-12-311-2/+1
* | treewide: isCoercibleToString -> isMoreCoercibleToString•••No change in behavior. Robert Hensing2022-12-312-3/+3
* | lib.strings: Rename isCoercibleToString -> isMoreCoercibleToStringRobert Hensing2022-12-311-2/+11
* | lib.types.anything: Use isSimpleCoercibleToString•••Expecting no change in behavior. Robert Hensing2022-12-311-1/+2
* | lib.strings.toShellVar: Use isSimpleCoercibleString•••Expecting no change in behavior. Robert Hensing2022-12-311-1/+1
* | lib.strings.isStorePath: Use isSimpleCoercibleToString•••Expecting no change in behavior. Robert Hensing2022-12-311-1/+1
* | lib.strings: Add isSimpleCoercibleToStringRobert Hensing2022-12-311-0/+11
* | Merge pull request #207453 from p-h/ulogd•••ulogd: init at 2.0.8Ryan Lahfa2022-12-301-0/+6
|\ \
| * | linuxdoc-tools: init at 0.9.82•••Heavily based on original work by xvuko Co-authored-by: xvuko <nix@vuko.pl> Philippe Hürlimann2022-12-281-0/+6
* | | lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing2022-12-291-1/+1
* | | Revert "lib/types: remove loaOf"•••This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users. Robert Hensing2022-12-291-0/+9
|/ /
* | Merge pull request #207095 from ncfavier/linux-custom-kernelNaïm Favier2022-12-272-0/+30
|\ \
| * | lib/versions: add `pad`•••Pad a version string with zeros to match a given number of components. Naïm Favier2022-12-212-0/+30
* | | Merge pull request #206809 from SuperSandro2000/loaOfSandro2022-12-251-9/+0
|\ \ \
| * | | lib/types: remove loaOfSandro Jäckel2022-12-191-9/+0
* | | | attrsets: fix and add some doc typeshsjobeki2022-12-242-27/+38
| |_|/ |/| |
* | | Merge pull request #205899 from drupol/font/add-garamond-libre•••garamond-libre: init at 1.4Sandro2022-12-201-0/+5
|\ \ \
| * | | garamond-libre: init at 1.4Pol Dellaiera2022-12-201-0/+5
| | |/ | |/|
* | | lib/strings: replace poop emoji (#206999)Naïm Favier2022-12-201-1/+1
* | | Merge pull request #205563 from hercules-ci/lib-modules-doc-default-and-examp...•••lib.modules: Add error context to rendered default and example attrsRobert Hensing2022-12-192-4/+18
|\ \ \ | |/ / |/| |
| * | lib.generators.toPretty: Add attribute name to error contextRobert Hensing2022-12-101-1/+4
| * | lib.modules: Add error context to rendered default and example attrsRobert Hensing2022-12-101-3/+14