Commit graph

4472 commits

Author SHA1 Message Date
Silvan Mosberger
7277b3a840
doc: improve lib.compareLists documentation (#368360) 2025-01-13 21:10:51 +01:00
Tristan Ross
41b14024d2
pkgs/top-level/stage.nix: add pkgsLLVMLibc 2025-01-10 20:54:19 -08:00
Johannes Kirschbauer
477b98b2a9
doc: improve lib.compareLists documentation 2025-01-09 11:25:44 +01:00
piegames
31777a589c
More string fixes (#367757) 2025-01-08 20:12:26 +01:00
Johannes Kirschbauer
8d18b516a2
docs: init lib.stringsWithDeps.textClosureList (#369776) 2025-01-08 13:43:09 +01:00
piegames
dd7d5339f7 treewide: Fix incorrect string indentations 2025-01-07 19:49:28 +01:00
piegames
603733851b treewide: Fix incorrect string escapes 2025-01-07 19:49:28 +01:00
Johannes Kirschbauer
5782ef8dc3
lib/types: deprecate functor.wrapped in types.listOf 2025-01-06 16:01:02 +01:00
Johannes Kirschbauer
3d92f38fbd
lib/types: refactor elemTypeFunctor for types.attrsWith 2025-01-06 15:24:48 +01:00
Robert Hensing
782a0e6581 lib.dropEnd: init
Naming borrowed from Haskell
- `base`: [`dropWhileEnd`]
- `extra`, `mono-traversable`, ...: [`dropEnd`]

[`dropEnd`]: https://hackage.haskell.org/package/mono-traversable-1.0.21.0/docs/Data-Sequences.html#v:dropEnd
[`dropWhileEnd`]: https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List.html#v:dropWhileEnd
2025-01-03 12:04:06 +01:00
Robert Hensing
c96e907825 lib/tests/misc: Test lib.drop 2025-01-03 12:03:33 +01:00
Johannes Kirschbauer
e51cc8a2a6
lib.collectModules: improve readability by replacing implication 2024-12-31 22:47:20 +01:00
Weijia Wang
2927d4b6ba lib/trivial: update oldestSupportedRelease 2024-12-31 22:15:23 +01:00
nicoo
f91fbd1624
Merge #361424: refactor lib.packagesFromDirectoryRecursive (v2) 2024-12-28 21:11:11 +00:00
Vladimír Čunát
fc9c33366b
staging-next 2024-12-04 (#361878) 2024-12-23 14:57:53 +01:00
Silvan Mosberger
d510f60a4d
lib.generators.toPlist: escape XML syntax in strings & keys (#356502) 2024-12-23 13:47:44 +01:00
Linnnus
d1cb670ee6 lib.generators.toPlist: escape XML syntax in strings & keys
Before this patch, code like this would break generate invalid XML:

    lib.generators.toPlist {} "ab<cd"

That's obviously bad, since the call to toPlist often happens through
indirection, as is the case in e.g. the nix-darwin project. A user might
not realize that they have to escape the strings.

This patch adds the argument 'escape' to lib.generators.plist and emits
a warning if it is not set to true. In a future release, this behavior
should become the default.

I have also added a note for future maintainers, in case I forget to
actually remove the deprecated functionality in a future release.
2024-12-23 12:29:20 +01:00
github-actions[bot]
36d6a1bccd
Merge master into staging-next 2024-12-21 00:14:11 +00:00
Yueh-Shun Li
e5a9567c3a lib.customisation: remove dead code
Remove unneeded function inheritance in the let-in block.
2024-12-20 21:02:54 +08:00
Yueh-Shun Li
8788c4bff9 lib/customisation.nix: format with nixfmt-rfc-style 2024-12-20 20:57:46 +08:00
github-actions[bot]
12c211c64e
Merge master into staging-next 2024-12-18 00:15:09 +00:00
Robert Hensing
efd4a649fe lib/tests/release.nix: Expose system parameter 2024-12-16 23:49:08 +01:00
github-actions[bot]
8c5656aa89
Merge master into staging-next 2024-12-15 00:17:27 +00:00
sternenseemann
a0a35b6c24
Fix cross eval issues (#362546) 2024-12-14 22:14:52 +01:00
Artturin
764c99481a lib/tests/release.nix: Fix build if impure.nix returns a cross pkgs
In https://www.github.com/NixOS/nixpkgs/pull/341067 `ofborg-eval-lib-tests`
fails because it uses `pkgsHostTarget` of the cross pkgs

```diff
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix
index 4d847e280f4b..7f0099b254f0 100644
--- a/pkgs/top-level/impure.nix
+++ b/pkgs/top-level/impure.nix
@@ -86,4 +86,6 @@ assert args ? system -> !(args ? localSystem);

 import ./. (builtins.removeAttrs args [ "system" ] // {
   inherit config overlays localSystem;
-})
+} // (if ((localSystem.system or localSystem) == "x86_64-linux" || (localSystem.system or localSystem) == "aarch64-linux") then {
+  crossSystem = { config = "aarch64-unknown-linux-gnu"; };
+  } else {}) )
```
2024-12-12 21:09:56 +02:00
nicoo
065b48084f lib.packagesFromDirectoryRecursive: let-bind functions called from lib
I was told it is better for eval performance:
  https://github.com/NixOS/nixpkgs/pull/361424#discussion_r1879975642
2024-12-12 18:48:45 +00:00
nicoo
1db8650fb4 lib.packagesFromDirectoryRecursive: refactor, again
This is a second take on #359941, which was reverted by
  940db5766a.

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-12-12 18:48:09 +00:00
K900
81eb6d64ab Merge remote-tracking branch 'origin/master' into staging-next 2024-12-12 21:08:33 +03:00
Jean-François Roche
fc31945f1e
lib/systems/parse.nix: mkSkeletonFromList: improve error message (#211213)
Include the system string in the error message to give a bit more context to
the user.

Co-authored-by: Wolfgang Walther <wolfgangwalther@users.noreply.github.com>
2024-12-12 18:30:47 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Silvan Mosberger
84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
github-actions[bot]
ceb62729d2
Merge master into staging-next 2024-12-09 18:05:05 +00:00
Silvan Mosberger
33fe023937
lib/types: make pattern of strMatching accessible (#350467) 2024-12-09 17:53:38 +01:00
Silvan Mosberger
3fe041e8bf lib.types: Add test for merging strMatching 2024-12-09 17:40:32 +01:00
Silvan Mosberger
062945b725
lib.types: chore use consistent payload form (#363565) 2024-12-09 16:23:19 +01:00
Johannes Kirschbauer
d504a1e680
lib.types.attrsWith: add placeholder parameter 2024-12-09 15:25:18 +01:00
Johannes Kirschbauer
f407f6f57e
lib.types: chore use consistent payload form 2024-12-09 14:09:16 +01:00
github-actions[bot]
38a78130f6
Merge master into staging-next 2024-12-08 12:05:39 +00:00
Silvan Mosberger
944f47455e
lib: add defaultTo (#357681) 2024-12-08 10:24:42 +01:00
github-actions[bot]
0597be32bd
Merge master into staging-next 2024-12-06 12:05:59 +00:00
Silvan Mosberger
2936a2ab9b
lib.strings.concatMapAttrsStringSep: init (#330010) 2024-12-06 09:53:50 +01:00
Yueh-Shun Li
b1371135b5 lib.strings.concatMapAttrsStringSep: init 2024-12-06 11:02:26 +08:00
github-actions[bot]
35ce54d1fd
Merge master into staging-next 2024-12-05 00:15:50 +00:00
Silvan Mosberger
5adee31c11
lib/types: init {types.attrsWith} (#361391) 2024-12-04 20:51:29 +01:00
github-actions[bot]
31c37acde9
Merge staging-next into staging 2024-12-04 18:05:21 +00:00
nicoo
2f9d395f05
lib.packagesFromDirectoryRecursive: Improved documentation (#359898) 2024-12-04 16:45:45 +00:00
github-actions[bot]
df7560310e
Merge staging-next into staging 2024-12-03 12:06:35 +00:00
nicoo
25bdcd51e8 lib.packagesFromDirectoryRecursive: Split and explain examples, warn about scope limitation 2024-12-03 11:01:28 +00:00
nicoo
781b44b39d lib.packagesFromDirectoryRecursive: document inputs better
Cut out redundant boilerplate, explain what the `callPackage` parameter is.

Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2024-12-03 11:01:12 +00:00
Johannes Kirschbauer
ce8f304bb6
lib.types.attrsWith: remove failing test 2024-12-03 10:04:27 +01:00