summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* Merge pull request #245623 from tweag/fileset.toSourceSilvan Mosberger2023-09-02
|\ | | | | File set combinators base: `lib.fileset.toSource`
| * lib.fileset.toSource: initSilvan Mosberger2023-09-01
| |
* | Merge pull request #234615 from linsui/dconfJan Tojnar2023-08-28
|\ \ | | | | | | nixos/dconf: support generating from attrs
| * | nixos/dconf: add settings supportlinsui2023-08-15
| | |
| * | lib/gvariant: initlinsui2023-08-15
| | |
* | | makeScopeWithSplicing: fix `makeScopeWithSplicing'` callArtturin2023-08-21
| | | | | | | | | | | | makeScopeWithSplicing: fix comment
* | | Merge pull request #245957 from ↵Artturi2023-08-20
|\ \ \ | | | | | | | | | | | | amjoseph-nixpkgs/pr/lib/customization/makeScopeWithSplicing2
| * | | lib.customisation: add uncurried form of makeScopeWithSplicingAdam Joseph2023-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | lib/modules: Report a better error when option tree has bare typeRobert Hensing2023-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improves on 0d472a62012364d064f0b75f1da491242c6ae9c6 - https://github.com/NixOS/nixpkgs/pull/242339 We actually do have the file name. Thanks Shawn8901 for the [feedback]! feedback: https://github.com/NixOS/nixpkgs/pull/242339#issuecomment-1683107055
* | | | Merge pull request #238509 from amjoseph-nixpkgs/pr/knuth/respectJohn Ericson2023-08-16
|\ \ \ \ | | | | | | | | | | lib/systems/parse.nix: show respect where deserved
| * | | | lib/systems/parse.nix: show respect where deservedAdam Joseph2023-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The eminent Donald E. Knuth should be recognized as having equal standing with such entities as IBM, Apple, and the Personal Computer. We should acknowledge this by including him as a "vendor". Also, `gnu-config` recognizes `mmix-knuth-*` triples (and in fact requires `vendor="knuth"` when `cpu="mmix"`) -- so we sort of have to. But we should do it anyways.
* | | | | Merge pull request #248895 from Scrumplex/getExe2Silvan Mosberger2023-08-16
|\ \ \ \ \
| * | | | | lib/meta.nix: recommend use of getExe' in getExe warningSefa Eyeoglu2023-08-15
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
| * | | | | lib/meta.nix: introduce getExe'Sefa Eyeoglu2023-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getExe' can be used to get a binary other than the mainProgram from a derivation. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
* | | | | | lib.removePrefix: OptimiseSilvan Mosberger2023-08-14
| | | | | |
* | | | | | lib.removePrefix: Add testsSilvan Mosberger2023-08-14
| |_|_|/ / |/| | | |
* | | | | Merge pull request #243511 from tweag/lib.lists.hasPrefixSilvan Mosberger2023-08-14
|\ \ \ \ \ | | | | | | | | | | | | `lib.lists.{hasPrefix,removePrefix}`: init
| * | | | | lib.lists.removePrefix: initSilvan Mosberger2023-07-14
| | | | | |
| * | | | | lib.lists.hasPrefix: initSilvan Mosberger2023-07-14
| | | | | |
* | | | | | Merge pull request #242339 from hercules-ci/modules-catch-bare-typeSilvan Mosberger2023-08-14
|\ \ \ \ \ \ | | | | | | | | | | | | | | lib/modules: Report a good error when option tree has bare type
| * | | | | | lib/modules: Report a good error when option tree has bare typeRobert Hensing2023-08-14
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | Note that this removes the possibility of declaring an option named `_type`.
* / | | | | lib.customisation.makeScope: Make `overrideScope` consistent with ↵Artturin2023-08-14
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `makeScopeWithSplicing` Right now converting `makeScope` to `makeScopeWithSplicing` is not transparent to users and requires adding a warning for `overrideScope'` in the set itself. Warning and `overrideScope'` were added in 2018 b9dce11712d2bfc8cd367df5a7f737a5cec1e252 and there should be no users left after 5 years.
* | | | | Merge pull request #247825 from tweag/lib.path-mdSilvan Mosberger2023-08-12
|\ \ \ \ \ | | | | | | | | | | | | Minor `lib.path` documentation consistency improvements
| * | | | | lib.path: Add argument docs when missingSilvan Mosberger2023-08-08
| | | | | |
| * | | | | 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 `+ ("/"`
* | | | | | lib/path/tests: Fix test setup on darwinRobert Hensing2023-08-11
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | These statements are taken from the `lib/test/release.nix` tests, which previously also worked on darwin. Unblocks https://github.com/NixOS/nix/pull/8569 when backported
* | | | | Merge pull request #248278 from infinisil/revert-strings-errorSilvan Mosberger2023-08-10
|\ \ \ \ \ | | | | | | | | | | | | Change `types.string` error to a warning instead
| * | | | | lib.types.string: Use lib.warn instead of deprecationMessageSilvan Mosberger2023-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will cause a poorer error message without option location information, but it will catch all uses of its use.
| * | | | | Revert "lib.types.string: Deprecation error instead of warning"Silvan Mosberger2023-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c59c6b1c57da542b6b4af5d2ac27d1b99e7f0c5e. This was a bit too ambitious, because no warnings were previously triggered when `string` was nested e.g. `attrsOf string`, `nullOr string`, etc. Support for nested type deprecation warnings was introduced in 4b54aedee5e05aaf2838f6d951508b83e33d2baa, but had to be reverted in a36e6760e9be0ec260b637a06d751d39e2a78e4e because it caused infinite recursion for some users, and I couldn't remember that it was reverted.
* | | | | | Merge pull request #235625 from ShamrockLee/lib-doc-tidySilvan Mosberger2023-08-10
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | lib: fix nix-doc variable "Type" in commentYueh-Shun Li2023-06-03
| | | | | | | | | | | | | | | | | | | | | | | | Fix documentation of lib.trivial.importJSON and lib.trivial.importTOML
* | | | | | lib.types.string: Deprecation error instead of warningSilvan Mosberger2023-08-08
| |/ / / / |/| | | | | | | | | | | | | | The type has given a warning on use since [4 years ago](03392cd336b128a1639c648baf0f6c1a1271e0d2), I think it's safe to move the deprecation to the next stage: An error instead of a warning.
* | | | | 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
| | | | | | | |