summaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Expand)AuthorAgeFilesLines
* Revert "lib.customisation: uncurry makeScopeWithSplicing"Silvan Mosberger2023-07-281-14/+8
* lib.makeScopeWithSplicing: provide default for keep,extra•••These are often unneeded by the user. Artturin2023-07-281-1/+9
* lib.customisation: uncurry makeScopeWithSplicing•••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 switch to attrset-passing form, to provide some minimal level of sanity-checking. Adam Joseph2023-07-271-8/+6
* Merge pull request #244358 from tweag/lib.path.parts•••`lib.path.splitRoot`: initRobert Hensing2023-07-272-1/+67
|\
| * lib.path.subpath.isValid: Add definition of a subpath•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Silvan Mosberger2023-07-261-0/+3
| * lib.path.splitRoot: init•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Silvan Mosberger2023-07-262-1/+64
* | Merge pull request #245271 from sternenseemann/module-system-merge-no-type•••lib/modules: handle typeless options in mergeModulesRobert Hensing2023-07-273-1/+29
|\ \
| * | lib/modules: handle typeless options in mergeModules•••mkOption does not require a `type` argument and does not set the resulting attribute if it is not given. Consequently, we need to be prepared to merge options that have no type information. sternenseemann2023-07-263-1/+29
* | | Merge pull request #243520 from tweag/lib.lists.commonPrefix•••`lib.lists.{findFirstIndex,commonPrefix}`: initSilvan Mosberger2023-07-262-29/+124
|\ \ \
| * | | lib.lists.commonPrefix: initSilvan Mosberger2023-07-202-1/+60
| * | | lib.lists.findFirstIndex: init•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Silvan Mosberger2023-07-192-28/+64
* | | | Merge pull request #244819 from ncfavier/toKeyValue-indent•••lib/generators/toKeyValue: add `indent` parameterNaïm Favier2023-07-251-2/+3
|\ \ \ \
| * | | | lib/generators/toKeyValue: add `indent` parameter•••toKeyValue is generic enough that it is sometimes used as part of other format generators, where it might be useful to specify the indentation level. Naïm Favier2023-07-221-2/+3
* | | | | Merge pull request #244330 from thillux/bluefield2-remove-cpu•••lib.systems.bluefield2: remove cpu profileAdam Joseph2023-07-241-1/+0
|\ \ \ \ \
| * | | | | lib.systems.bluefield2: remove cpu profile•••Some software, e.g. systemd, failed to build with set cpu profile. Signed-off-by: Markus Theil <theil.markus@gmail.com> Markus Theil2023-07-191-1/+0
* | | | | | Merge pull request #242035 from Icy-Thought/zsh-abbr•••zsh-abbr: init at 5.1.0Sandro2023-07-231-0/+7
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | licenses: add Hippocratic License v3.0Icy-Thought2023-07-071-0/+7
* | | | | | Merge pull request #244118 from amjoseph-nixpkgs/pr/fix/244045•••lib.systems.extensions.sharedLibrary: do not `throw`Adam Joseph2023-07-201-5/+6
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | |
| * | | | | lib.systems.extensions.sharedLibrary: do not `throw`•••Because downstream code expects to use `==` on platform attrsets, we are unfortunately not able to throw a useful error message when the `sharedLibrary` attribute is accessed. When users do a comparison like: stdenv.hostPlatform == pkgsStatic.stdenv.hostPlatform ... in a situation where `stdenv.hostPlatform.hasSharedLibraries`, they expect this to return `false`. Unfortunately Nix does a deep equality comparison here, and ends up forcing the `pkgsStatic.stdenv.hostPlatform.extensions.sharedLibrary` attribute, which throws the error. Rather than returning `null`, this commit instead simply omits the `extensions.sharedLibrary` attribute. This provides the user with a more-useful error message: instead of waiting until the `null` is used (and hoping that produces an error), the user will get an error about the `extensions.sharedLibrary` attribute being missing, at the position where it was referenced. Big thanks to @trofi for his PR to add `NIX_VALIDATE_EVAL_NONDETERMINISM` to Nix, which I am now using. It made tracking this down really easy! Fixes #244045 Adam Joseph2023-07-041-5/+6
* | | | | | Merge pull request #238013 from tweag/lib.path.removePrefix•••`lib.path.removePrefix`: initRobert Hensing2023-07-192-1/+71
|\ \ \ \ \ \
| * | | | | | lib.path.removePrefix: initSilvan Mosberger2023-07-102-1/+71
* | | | | | | Merge pull request #244044 from tweag/lib-readme•••Create a Readme in `lib`Robert Hensing2023-07-195-6/+107
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | |
| * | | | | | lib/tests: Unify documentation of individual testable filesSilvan Mosberger2023-07-184-6/+34
| * | | | | | lib: Add README•••Co-authored-by: Alexander Groleau <alex@proof.construction> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Silvan Mosberger2023-07-181-0/+73
* | | | | | | lib.attrsets.mergeAttrsList: init•••Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Silvan Mosberger2023-07-182-0/+61
| |_|/ / / / |/| | | | |
* | | | | | lib.systems.bluefield2: init•••Add support for Nvidia's Bluefield 2 plattform as a compilation target. There exists a version with and without crypto support, while the crypto supported version is the most common one. Support for the non-crypto version can be easily added in the future, if needed. For a datasheet of the hardware, see: https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/documents/datasheet-nvidia-bluefield-2-dpu.pdf Signed-off-by: Markus Theil <theil.markus@gmail.com> Markus Theil2023-07-142-0/+12
* | | | | | Merge pull request #238154 from amjoseph-nixpkgs/pr/gcc/crossStageStatic•••gccCrossStageStatic: enable dynamic libraries, rename itAdam Joseph2023-07-121-1/+20
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | |
| * | | | | lib.systems: introduce hasSharedLibraries•••This commit adds `hasSharedLibraries` to `lib.systems`. We need `plat.hasSharedLibraries` in order to know whether or not to expect `gcc` (and many other tools) to emit shared libraries (like `libgcc_s.so`). Many of the GNU build scripts are smart enough that if you configure them with `--enable-shared` on a platform (such as `arm-none-eabi`) that doesn't support dynamic linking, they will simply skip the shared libraries instead of aborting the `configurePhase`. Unfortunately the missing shared libraries in the final build product cause very hard-to-troubleshoot problems later on. The alternative to introducing `hasSharedLibraries` would be to set `isStatic` in these situations. However doing so causes `make-derivation.nix` to insert `-static` between the `pname` and `hostPlatform` suffix, which is undesirable. If at some point in the future we eliminate the `-static` suffix, then `hasSharedLibraries` can be made equal to `!isStatic`. Adam Joseph2023-07-011-1/+20
* | | | | | lib.mergeModules: Add context to error messageRobert Hensing2023-07-112-2/+5
* | | | | | lib/modules.nix: FormatRobert Hensing2023-07-111-19/+28
* | | | | | lib/modules.nix: Inline single-use `subtree` bindingsRobert Hensing2023-07-111-4/+4
* | | | | | lib/modules.nix: Make entire definition list strict in config check•••This is a non-trivial refactor that slightly changes the semantics of the internal definition lists. Whereas previously only individual list items would trigger the exception, now the error is promoted to the whole list. This is mostly ok, because we compute the value, it is wrong to ignore a definition. However, we don't always compute the value. For instance `readOnly` only needs to count definitions. That won't be possible anymore when the error is raised for one of the items. As a consequence, an error will be raised for the errant definition instead of the number of definitions. Robert Hensing2023-07-111-24/+21
* | | | | | lib/modules.nix: Rename defnsByName -> pushedDownDefinitionsByNameRobert Hensing2023-07-111-2/+2
* | | | | | lib/modules.nix: Rename defnsByName' -> rawDefinitionsByNameRobert Hensing2023-07-111-3/+3
* | | | | | lib/modules.nix: Apply argument `module` of old fRobert Hensing2023-07-111-9/+9
* | | | | | lib/modules.nix: Apply argument `modules` of old old old byNameRobert Hensing2023-07-111-6/+6
* | | | | | lib/modules.nix: Apply argument `f` of old old byNameRobert Hensing2023-07-111-15/+21
* | | | | | lib/modules.nix: Apply argument `attr` of old byNameRobert Hensing2023-07-111-31/+15
* | | | | | lib/modules.nix: Inline byName•••byName is not an abstraction. This is the first commit in a series that refactors it away. Robert Hensing2023-07-111-27/+43
* | | | | | doc: Render lib.fixedPointsRobert Hensing2023-07-081-81/+115
| |_|_|/ / |/| | | |
* | | | | Merge pull request #240825 from r-burns/mips-embedded•••lib.platforms.mips{,64}-embedded: initRyan Burns2023-07-053-2/+12
|\ \ \ \ \
| * | | | | lib.platforms.mips{,64}-embedded: initRyan Burns2023-06-303-2/+12
| | |_|_|/ | |/| | |
* | | | | Merge pull request #241645 from ncfavier/lib-no-hashes•••lib/tests: invalidate hashesNaïm Favier2023-07-052-6/+6
|\ \ \ \ \
| * | | | | lib/tests: invalidate hashes•••Having the current bash hash present in the nixpkgs tree makes Nix detect bash as a runtime dependency of nixpkgs, which in turns messes up `fetchFromGitHub` due to https://github.com/NixOS/nix/issues/6660 Naïm Favier2023-07-052-6/+6
* | | | | | Merge pull request #239120 from LibreCybernetics/arch-stuffArtturi2023-07-051-11/+28
|\ \ \ \ \ \
| * | | | | | lib.systems.architectures: add microarchitecture levels•••Variation on: - https://github.com/NixOS/nixpkgs/pull/208398 - https://github.com/NixOS/nixpkgs/pull/224978 Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com> Co-authored-by: Shawn8901 <shawn8901@googlemail.com> Co-authored-by: AveryanAlex <alex@averyan.ru> Fabián Heredia Montiel2023-06-241-11/+28
* | | | | | | Merge pull request #240555 from Artturin/iniglobsecneedArtturi2023-07-041-1/+1
|\ \ \ \ \ \ \
| * | | | | | | lib.generators.toINIWithGlobalSection: give sections a default•••often sections aren't needed when using globalSection currently one has to `sections = { }` when using only globalSection ``` lib.generators.toINIWithGlobalSection { } { globalSection = { background_color = "1d202199"; }; sections = { }; }; ```` Artturin2023-06-291-1/+1
* | | | | | | | lib/trivial: Bump oldestSupportedReleaseto to 23.05Martin Weinelt2023-07-041-1/+1
| |_|/ / / / / |/| | | | | |
* | | | | | | Merge pull request #237895 from emilytrau/tart•••tart: init at 1.6.0Pol Dellaiera2023-07-021-0/+7
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | |