summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* Merge pull request #205190 from NixOS/lib.path.relativeNormaliseRobert Hensing2023-01-03
|\ | | | | lib.path.subpath.{isValid,normalise}: init
| * lib.path.subpath.normalise: add property testsSilvan Mosberger2023-01-03
| |
| * lib.path.subpath.normalise: initSilvan Mosberger2023-01-03
| |
| * lib.path.subpath.isValid: initSilvan Mosberger2023-01-03
| | | | | | | | The first path library function
| * lib.path: init README.md documentSilvan Mosberger2023-01-03
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #208698 from amjoseph-nixpkgs/pr/nss/ilp32Martin Weinelt2023-01-03
|\ \
| * | lib/systems/inspect.nix: add isILP32 predicateAdam Joseph2023-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | lib/systems: fix uname.processor for powerpc{32,64}, mips64Adam Joseph2023-01-01
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | lib/trival: Bump oldestSupportedRelease to 2211Martin Weinelt2023-01-01
| |
* | stdenv/check-meta: do deep type checksNaïm Favier2023-01-01
| | | | | | | | | | Use a wrapper around `mergeDefinitions` to type-check values deeply, so that e.g. `maintainers = [ 42 ];` is an error.
* | lib/customisation.overrideDerivation: propagate evaluation conditionNaïm Favier2023-01-01
| | | | | | | | | | | | | | | | | | | | | | 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`.
* | lib: Add isStringLikeRobert Hensing2022-12-31
| |
* | lib.isStringLike: Remove use of listRobert Hensing2022-12-31
| | | | | | | | | | | | 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.
* | lib: Add isPathRobert Hensing2022-12-31
| | | | | | | | | | Available since Nix 2.3, which is the Nixpkgs minimum version. Thanks zimbatm!
* | lib.strings.isConvertibleWithToString: Refactor to reuse isStringLikeRobert Hensing2022-12-31
| |
* | lib.strings: isMoreCoercibleString -> isConvertibleWithToStringRobert Hensing2022-12-31
| | | | | | | | | | | | | | 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.
* | lib.strings: isSimpleCoercibleString -> isStringLikeRobert Hensing2022-12-31
| |
* | lib.types.path: Do not allow lists of stringsRobert Hensing2022-12-31
| |
* | treewide: isCoercibleToString -> isMoreCoercibleToStringRobert Hensing2022-12-31
| | | | | | | | No change in behavior.
* | lib.strings: Rename isCoercibleToString -> isMoreCoercibleToStringRobert Hensing2022-12-31
| |
* | lib.types.anything: Use isSimpleCoercibleToStringRobert Hensing2022-12-31
| | | | | | | | Expecting no change in behavior.
* | lib.strings.toShellVar: Use isSimpleCoercibleStringRobert Hensing2022-12-31
| | | | | | | | Expecting no change in behavior.
* | lib.strings.isStorePath: Use isSimpleCoercibleToStringRobert Hensing2022-12-31
| | | | | | | | Expecting no change in behavior.
* | lib.strings: Add isSimpleCoercibleToStringRobert Hensing2022-12-31
| |
* | Merge pull request #207453 from p-h/ulogdRyan Lahfa2022-12-30
|\ \ | | | | | | ulogd: init at 2.0.8
| * | linuxdoc-tools: init at 0.9.82Philippe Hürlimann2022-12-28
| | | | | | | | | | | | | | | | | | Heavily based on original work by xvuko Co-authored-by: xvuko <nix@vuko.pl>
* | | lib.types.loaOf: Update comment to say deprecate instead of removeRobert Hensing2022-12-29
| | |
* | | Revert "lib/types: remove loaOf"Robert Hensing2022-12-29
|/ / | | | | | | | | | | | | This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users.
* | Merge pull request #207095 from ncfavier/linux-custom-kernelNaïm Favier2022-12-27
|\ \
| * | lib/versions: add `pad`Naïm Favier2022-12-21
| | | | | | | | | | | | Pad a version string with zeros to match a given number of components.
* | | Merge pull request #206809 from SuperSandro2000/loaOfSandro2022-12-25
|\ \ \
| * | | lib/types: remove loaOfSandro Jäckel2022-12-19
| | | |
* | | | attrsets: fix and add some doc typeshsjobeki2022-12-24
| |_|/ |/| |
* | | Merge pull request #205899 from drupol/font/add-garamond-libreSandro2022-12-20
|\ \ \ | | | | | | | | garamond-libre: init at 1.4
| * | | garamond-libre: init at 1.4Pol Dellaiera2022-12-20
| | |/ | |/|
* | | lib/strings: replace poop emoji (#206999)Naïm Favier2022-12-20
| | |
* | | Merge pull request #205563 from ↵Robert Hensing2022-12-19
|\ \ \ | |/ / |/| | | | | | | | hercules-ci/lib-modules-doc-default-and-example-error-context lib.modules: Add error context to rendered default and example attrs
| * | lib.generators.toPretty: Add attribute name to error contextRobert Hensing2022-12-10
| | |
| * | lib.modules: Add error context to rendered default and example attrsRobert Hensing2022-12-10
| | |
* | | lib: fix typosfigsoda2022-12-17
| |/ |/|
* | lib.replaceChars: warn about being a deprecated aliasArtturin2022-12-15
| | | | | | | | | | | | | | | | replaceStrings has been in nix since 2015(nix 1.10) so it is safe to remove the fallback https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb
* | Merge pull request #205457 from ↵Robert Hensing2022-12-11
|\ \ | |/ |/| | | | | h7x4/lib-strings-toInt-broken-for-negative-numbers lib.strings: fix negative number handling for `toInt` and `toIntBase10`
| * lib.strings: fix negative number handling for `toInt` and `toIntBase10`h7x42022-12-10
| | | | | | | | | | The previous version would be unstable due to an input validation regex not expecting a '-' in front of the number.
* | Merge pull request #126213 from ryantm/lib-doc-genValentin Gagarin2022-12-09
|\ \ | | | | | | doc: auto-generate asserts and attrset library docs
| * | doc: auto-generate asserts and attrset library docsRyan Mulligan2022-12-08
| | | | | | | | | | | | | | | | | | | | | | | | If all the docs are auto-generated, it should be easier to convert them to Commonmark. Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
* | | nixos/doc: render option values using `lib.generators.toPretty`Naïm Favier2022-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Render un`_type`d defaults and examples as `literalExpression`s using `lib.generators.toPretty` so that consumers don't have to reinvent Nix pretty-printing. `renderOptionValue` is kept internal for now intentionally. Make `toPretty` print floats as valid Nix values (without a tilde). Get rid of the now-obsolete `substSpecial` function. Move towards disallowing evaluation of packages in the manual by raising a warning on `pkgs.foo.{outPath,drvPath}`; later, this should throw an error. Instead, module authors should use `literalExpression` and `mkPackageOption`.
* | | lib/generators.toPretty: escape strings properlyNaïm Favier2022-12-08
| | |
* | | lib/generators.toPretty: don't evaluate derivationsNaïm Favier2022-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the goal of making `toPretty` suitable for rendering option values, render derivations as `<derivation foo-1.0>` instead of `<derivation /nix/store/…-foo-1.0.drv>`. This is to avoid causing sudden evaluation errors for out-of-tree projects that have options with `default = pkgs.someUnfreePackage;` and no `defaultText`.
* | | Merge pull request #204087 from ncfavier/splitString-simplifyNaïm Favier2022-12-08
|\ \ \
| * | | lib/strings: simplify `splitString`Naïm Favier2022-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to use `unsafeDiscardStringContext` since https://github.com/NixOS/nix/commit/ee7fe64c0ac00f2be11604a2a6509eb86dc19f0a (Nix 1.8). Also the separator can't have a context since `builtins.split` would fail, so we can assume it doesn't.