about summary refs log tree commit diff
path: root/lib/default.nix
AgeCommit message (Collapse)AuthorFilesLines
2024-06-20lib.split: Export from lib.strings.splitSilvan Mosberger1-1/+1
2024-06-20lib.match: Export from lib.strings.matchSilvan Mosberger1-1/+1
2024-06-20lib.removeAttrs: Export from lib.attrsets.removeAttrsSilvan Mosberger1-1/+1
2024-06-20lib.intersectAttrs: Export from builtinsSilvan Mosberger1-1/+1
2024-06-20lib.map: Export from lib.lists.mapSilvan Mosberger1-1/+1
2024-04-22Merge pull request #214021 from tweag/ifilter0Silvan Mosberger1-1/+1
lib.lists.ifilter0: init
2024-04-22lib.lists.ifilter0: initSilvan Mosberger1-1/+1
2024-04-21lib: Document status of deprecated.nix and move itRobert Hensing1-1/+1
This is all I could find after co-maintaining lib for a long time. I've had the fortune of basically not really noticing this file, because it has had very few interactions until the confusion in https://github.com/NixOS/nixpkgs/pull/304277 It seems to be a state of limbo, which would be nice to resolve (with great care), but this is not urgent, and first we should document its status.
2024-04-19Merge pull request #298680 from gvolpe/lib/transposeMapRick van Schijndel1-2/+2
lib/attrsets: add mapCartesianProduct function
2024-04-15lib: add mdDoc back in to provide proper warningéclairevoyant1-1/+1
2024-04-15lib/attrsets: introduce mapCartesianProductGabriel Volpe1-1/+1
2024-04-15lib/attrsets: rename cartesianProductOfSets to cartesianProductGabriel Volpe1-1/+1
2024-04-13lib: remove all uses of lib.mdDocstuebinm1-1/+1
this change is otherwise a no-op, as lib.mdDoc is already defined to be the identity function.
2024-04-09Merge pull request #284551 from hercules-ci/types-attrTagSilvan Mosberger1-1/+2
Add `types.attrTag`
2024-04-04lib: add xoredef1-1/+1
This gets clumsily reimplemented in various places, to no useful end.
2024-04-04lib.modules.evalOptionValue: Undeprecate for lib.typesRobert Hensing1-1/+2
lib.types.attrTag needs it.
2024-04-02lib/strings: Add makeIncludePath (#296237)Florian Richer1-1/+1
* Update strings.nix * Fix typo in docs * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/strings.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Add unit test with strings * Move test to strings * Add unit test with package structure * testMakeIncludePathWithPkgs: use real pkgs * Revert "testMakeIncludePathWithPkgs: use real pkgs" This reverts commit fb1850c069cfb324f3a43323da740a27a11793f3. * Update lib/tests/misc.nix Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> * Update lib/tests/misc.nix Co-authored-by: Silvan Mosberger <github@infinisil.com> --------- Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com> Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-02-26lib: export attrsets.mergeAttrsListSandro1-2/+2
2024-02-02lib: Add optionalDrvAttr to conditionally set drv attributes.Shea Levy1-1/+1
This allows for adding new, conditionally set, derivation attributes to an existing derivation without changing any output paths in the case where the condition is not met.
2023-12-19Merge pull request #270537 from 9999years/packagesFromDirectorySilvan Mosberger1-1/+2
lib.packagesFromDirectoryRecursive: init
2023-12-19lib.packagesFromDirectoryRecursive: initRebecca Turner1-1/+2
Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>
2023-12-08lib.sortOn: initRobert Hensing1-1/+1
A more efficient sort in some cases, and often convenient. This exposes `lib.lists.sortOn` immediately on `lib`, because it is a sibling of `sort`, which is already present there. Omitting it would lead to more confusion, and worse outcomes. There's no confusion about the types `sort` or `sortOn` operate on. Haskell agrees about the type for `sortOn`, and it is in its `base`.
2023-11-15Merge pull request #239722 from Stunkymonkey/lib-allUniqueSilvan Mosberger1-1/+1
lib.lists.allUnique: init
2023-11-14lib.lists.allUnique: initFelix Buehler1-1/+1
2023-11-07lib.mirrorFunctionArgs: initYueh-Shun Li1-1/+1
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2023-10-10Merge pull request #254452 from flyingcircusio/lib-attrsToListSilvan Mosberger1-2/+2
lib.attrsets.attrsToList: add function
2023-10-10lib.attrsets.attrsToList: add functionOliver Schmidt1-2/+2
For transforming back between lists and attrsets, it makes sense to have a quasi-inverse of `builtins.listToAttrs` available as a library function. Co-authored-by: Silvan Mosberger <github@infinisil.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-09-27lib: add cmakeOptionType, cmakeBool and cmakeFeatureAnderson Torres1-0/+1
2023-09-02Merge pull request #245623 from tweag/fileset.toSourceSilvan Mosberger1-0/+1
File set combinators base: `lib.fileset.toSource`
2023-09-01lib.fileset.toSource: initSilvan Mosberger1-0/+1
2023-08-28Merge pull request #234615 from linsui/dconfJan Tojnar1-0/+1
nixos/dconf: support generating from attrs
2023-08-20Merge pull request #245957 from ↵Artturi1-1/+1
amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing2
2023-08-15lib/gvariant: initlinsui1-0/+1
2023-08-14lib.customisation: add uncurried form of makeScopeWithSplicingAdam Joseph1-1/+1
Deeply-curried functions are pretty error-prone in untyped languages like Nix. This is a particularly bad case because `top-level/splice.nix` *also* declares a makeScopeWithSplicing, but it takes *two fewer arguments*. Let's add a version that uses attrset-passing form, to provide some minimal level of sanity-checking. This also provides defaults for keep and extra (these are often unneeded by the user).
2023-08-13lib/meta.nix: introduce getExe'Sefa Eyeoglu1-1/+1
getExe' can be used to get a binary other than the mainProgram from a derivation. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-06-13lib/options: remove literalDocBookpennae1-1/+1
no longer supported. warning when used would not be appropriate, and docbook has been on the way out for long enough that throwing an error should not be necessary either.
2023-04-05lib.sources.pathType and co.: Move to lib.filesystemSilvan Mosberger1-2/+3
These functions only work with the filesystem, they don't import anything as sources
2023-03-11init: lib.foldlAttrshsjobeki1-1/+1
- provide comprehensive example - add unit test
2023-03-08lib: remove deprecated functionspennae1-5/+4
all of these have been deprecated and raising warnings since 18.09. it's about time we actually made good on "will be removed in the next release".
2023-03-03strings: add escapeQuery for url encodingPatrick Widmer1-1/+1
2023-02-07Merge pull request #206611 from h7x4/lib-lists-add-repeatSilvan Mosberger1-1/+1
lib.lists: add `replicate`
2023-02-06lib.lists: add `replicate`h7x41-1/+1
`replicate` returns n copies of an element as a list. Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2023-01-31Merge pull request #205557 from ncfavier/concatLinesSilvan Mosberger1-1/+1
lib/strings: add `concatLines`
2023-01-05Merge pull request #208674 from YoshiRulz/yoshi-lib-docsSilvan Mosberger1-1/+1
lib: Fix mismatched quotes in `lib.*` doc comments
2023-01-05modules: add mkPackageOptionMDpennae1-1/+1
another transitional option factory, like mkAliasOptionModuleMD.
2023-01-05modules: add mkAliasOptionModuleMDpennae1-1/+2
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 Hensing1-1/+2
lib.path.subpath.{isValid,normalise}: init
2023-01-03lib.path.subpath.isValid: initSilvan Mosberger1-1/+2
The first path library function
2023-01-02lib: Fix mismatched quotes in `lib.*` doc commentsYoshiRulz1-1/+1
caused problems for automated rich text generation such as https://teu5us.github.io/nix-lib.html#customisation-functions
2022-12-31lib: Add isStringLikeRobert Hensing1-2/+4