about summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* lib.path: Indent comments the sameSilvan Mosberger2023-08-08
|
* lib.path: Make documentation more uniformSilvan Mosberger2023-08-08
| | | | | | | - Always have a trailing dot after sentences - Link more things - Fix some formatting - Use `append` instead of `+ ("/"`
* treewide: update mainProgram docsArtturin2023-08-04
|
* Merge pull request #242695 from tweag/lib.path.subpath.componentsRobert Hensing2023-08-04
|\ | | | | `lib.path.subpath.components`: init
| * lib/path/README.md: Justify returning subpathsSilvan Mosberger2023-07-26
| | | | | | | | Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
| * lib.path.subpath.components: initSilvan Mosberger2023-07-26
| | | | | | | | Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
* | Merge pull request #243139 from hercules-ci/modules-test-default-argumentRobert Hensing2023-08-02
|\ \ | | | | | | lib/tests/modules: Test that _module.args works when a default argume…
| * | lib/tests/modules: Test that _module.args works when a default argument is setRobert Hensing2023-07-12
| | |
* | | lib.getExe: Do not make assumptions about the main programRobert Hensing2023-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, getExe assumes that if `meta.mainProgram` is unset, it has a main program that's named after the package name. While this is probable, it leads to a bad error when the assumption does not hold. If the user called `getExe` themselves, they might narrow down the location of the assumption quite easily, but if that's not the case, they'll have to go down the rabbit hole to figure out what went wrong. For example, a NixOS module may use `lib.getExe` on a package-typed option which is then used in the system configuration. This then typically leads to a failure *after* deployment, which is bad, and it's quite likely that the user will debug the package output contents before digging through the NixOS module, which is bad. Furthermore the `getExe` call is rather inconspicuous as it does not contain something like "/bin/foo", which is bad. Also modules can be hard to read for a newbie, which is bad. All of this can be avoided by requiring `meta.mainProgram`. Many packages already have the attribute, and I would expect 80% of `getExe` usages to be covered by 20% of packages, because plenty of packages aren't used with `getExe` anyway. Finally we could make an effort to set `mainProgram` semi-automatically using `nix-index`.
* | | Revert "lib.customisation: uncurry makeScopeWithSplicing"Silvan Mosberger2023-07-28
| | |
* | | lib.makeScopeWithSplicing: provide default for keep,extraArtturin2023-07-28
| | | | | | | | | | | | These are often unneeded by the user.
* | | 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