about summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
...
* | | | | lib.customisation: uncurry makeScopeWithSplicingAdam Joseph2023-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #244358 from tweag/lib.path.partsRobert Hensing2023-07-27
|\ \ \ \ \ | | | | | | | | | | | | `lib.path.splitRoot`: init
| * | | | | lib.path.subpath.isValid: Add definition of a subpathSilvan Mosberger2023-07-26
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
| * | | | | lib.path.splitRoot: initSilvan Mosberger2023-07-26
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | | | | | Merge pull request #245271 from sternenseemann/module-system-merge-no-typeRobert Hensing2023-07-27
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib/modules: handle typeless options in mergeModules
| * | | | | | lib/modules: handle typeless options in mergeModulessternenseemann2023-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | Merge pull request #243520 from tweag/lib.lists.commonPrefixSilvan Mosberger2023-07-26
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | `lib.lists.{findFirstIndex,commonPrefix}`: init
| * | | | | | | lib.lists.commonPrefix: initSilvan Mosberger2023-07-20
| | | | | | | |
| * | | | | | | lib.lists.findFirstIndex: initSilvan Mosberger2023-07-19
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | | | | | | Merge pull request #244819 from ncfavier/toKeyValue-indentNaïm Favier2023-07-25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | lib/generators/toKeyValue: add `indent` parameter
| * | | | | | | lib/generators/toKeyValue: add `indent` parameterNaïm Favier2023-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Merge pull request #244330 from thillux/bluefield2-remove-cpuAdam Joseph2023-07-24
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | lib.systems.bluefield2: remove cpu profile
| * | | | | | | | lib.systems.bluefield2: remove cpu profileMarkus Theil2023-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some software, e.g. systemd, failed to build with set cpu profile. Signed-off-by: Markus Theil <theil.markus@gmail.com>
* | | | | | | | | Merge pull request #242035 from Icy-Thought/zsh-abbrSandro2023-07-23
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | zsh-abbr: init at 5.1.0
| * | | | | | | | licenses: add Hippocratic License v3.0Icy-Thought2023-07-07
| | | | | | | | |
* | | | | | | | | Merge pull request #244118 from amjoseph-nixpkgs/pr/fix/244045Adam Joseph2023-07-20
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / |/| | | | | | | | lib.systems.extensions.sharedLibrary: do not `throw`
| * | | | | | | | lib.systems.extensions.sharedLibrary: do not `throw`Adam Joseph2023-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | Merge pull request #238013 from tweag/lib.path.removePrefixRobert Hensing2023-07-19
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | `lib.path.removePrefix`: init
| * | | | | | | | | lib.path.removePrefix: initSilvan Mosberger2023-07-10
| | | | | | | | | |
* | | | | | | | | | Merge pull request #244044 from tweag/lib-readmeRobert Hensing2023-07-19
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / |/| | | | | | | | | Create a Readme in `lib`
| * | | | | | | | | lib/tests: Unify documentation of individual testable filesSilvan Mosberger2023-07-18
| | | | | | | | | |
| * | | | | | | | | lib: Add READMESilvan Mosberger2023-07-18
| | |_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | | lib.attrsets.mergeAttrsList: initSilvan Mosberger2023-07-18
| |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | | | | | | | lib.systems.bluefield2: initMarkus Theil2023-07-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Merge pull request #238154 from amjoseph-nixpkgs/pr/gcc/crossStageStaticAdam Joseph2023-07-12
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | gccCrossStageStatic: enable dynamic libraries, rename it
| * | | | | | | lib.systems: introduce hasSharedLibrariesAdam Joseph2023-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | | | | | | | lib.mergeModules: Add context to error messageRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: FormatRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Inline single-use `subtree` bindingsRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Make entire definition list strict in config checkRobert Hensing2023-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | lib/modules.nix: Rename defnsByName -> pushedDownDefinitionsByNameRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Rename defnsByName' -> rawDefinitionsByNameRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Apply argument `module` of old fRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Apply argument `modules` of old old old byNameRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Apply argument `f` of old old byNameRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Apply argument `attr` of old byNameRobert Hensing2023-07-11
| | | | | | | |
* | | | | | | | lib/modules.nix: Inline byNameRobert Hensing2023-07-11
| |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | byName is not an abstraction. This is the first commit in a series that refactors it away.
* | | | | | | doc: Render lib.fixedPointsRobert Hensing2023-07-08
| |_|_|/ / / |/| | | | |
* | | | | | Merge pull request #240825 from r-burns/mips-embeddedRyan Burns2023-07-05
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib.platforms.mips{,64}-embedded: init
| * | | | | | lib.platforms.mips{,64}-embedded: initRyan Burns2023-06-30
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #241645 from ncfavier/lib-no-hashesNaïm Favier2023-07-05
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib/tests: invalidate hashes
| * | | | | | lib/tests: invalidate hashesNaïm Favier2023-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | Merge pull request #239120 from LibreCybernetics/arch-stuffArtturi2023-07-05
|\ \ \ \ \ \ \
| * | | | | | | lib.systems.architectures: add microarchitecture levelsFabián Heredia Montiel2023-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | | Merge pull request #240555 from Artturin/iniglobsecneedArtturi2023-07-04
|\ \ \ \ \ \ \ \
| * | | | | | | | lib.generators.toINIWithGlobalSection: give sections a defaultArtturin2023-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 = { }; }; ````
* | | | | | | | | lib/trivial: Bump oldestSupportedReleaseto to 23.05Martin Weinelt2023-07-04
| |_|/ / / / / / |/| | | | | | |
* | | | | | | | Merge pull request #237895 from emilytrau/tartPol Dellaiera2023-07-02
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | tart: init at 1.6.0
| * | | | | | | licenses: add Fair Source License v0.9Emily Trau2023-06-16
| | | | | | | |
* | | | | | | | Merge pull request #239255 from figsoda/stringfigsoda2023-06-30
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | |