Skip to content

Commit

Permalink
lib.packagesFromDirectoryRecursive: reject unknown arguments
Browse files Browse the repository at this point in the history
see [discussion](NixOS#270537 (comment))
  • Loading branch information
nbraud committed Dec 28, 2024
1 parent daed3d7 commit ee249ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions lib/filesystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ in
newScope? :: AttrSet -> scope,
directory :: Path,
recurseIntoDirectory? :: (args -> AttrSet) -> args -> AttrSet,
...
recurseArgs? :: Any
}) -> AttrSet
```
Expand Down Expand Up @@ -349,6 +349,9 @@ in
```
:::
`recurseArgs`
: Optional argument, which can be used to hold data used by `recurseIntoDirectory`
# Examples
:::{.example}
## Basic use of `lib.packagesFromDirectoryRecursive`
Expand Down Expand Up @@ -421,8 +424,11 @@ in
in
{
callPackage,
newScope ? throw "lib.packagesFromDirectoryRecursive: newScope wasn't passed in args",
directory,
# recurseIntoDirectory can modify the function used when processing directory entries; see nixdoc above
# recurseIntoDirectory can modify the function used when processing directory entries
# and recurseArgs can (optionally) hold data for its use ; see nixdoc above
recurseArgs ? throw "lib.packagesFromDirectoryRecursive: recurseArgs wasn't passed in args",
recurseIntoDirectory ?
if args ? newScope then
# `processDir` is the same function as defined above
Expand All @@ -442,7 +448,6 @@ in
else
# otherwise, no modification is necessary
id,
...
}@args:
let
defaultPath = append directory "package.nix";
Expand Down
5 changes: 4 additions & 1 deletion nixos/doc/manual/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
- `renovate` was updated to v39. See the [upstream release notes](https://docs.renovatebot.com/release-notes-for-major-versions/#version-39) for breaking changes.
Like upstream's docker images, renovate now runs on NodeJS 22.

- [`lib.packagesFromDirectoryRecursive`] now rejects unknown arguments.
[`lib.packagesFromDirectoryRecursive`]: https://nixos.org/manual/nixpkgs/stable/#function-library-lib.filesystem.packagesFromDirectoryRecursive

- The behavior of the `networking.nat.externalIP` and `networking.nat.externalIPv6` options has been changed. `networking.nat.forwardPorts` now only forwards packets destined for the specified IP addresses.

- `python3Packages.jaeger-client` was removed because it was deprecated upstream. [OpenTelemetry](https://opentelemetry.io) is the recommended replacement.
Expand Down Expand Up @@ -271,7 +274,7 @@
- Overriding Wayland compositor is possible using `enableWaylandSession` option, but you might need to take care [`xfce4-session`](https://gitlab.xfce.org/xfce/xfce4-session/-/merge_requests/49), [`dbus-update-activation-environment`](https://github.com/labwc/labwc/blob/eaf11face68ee1f1bcc7ce1498304ca8c108c8ba/src/config/session.c#L234) and [`systemctl --user import-environment`](https://github.com/labwc/labwc/blob/eaf11face68ee1f1bcc7ce1498304ca8c108c8ba/src/config/session.c#L239) on startup.
- For new Xfce installations, default panel layout has [changed](https://gitlab.xfce.org/xfce/xfce4-panel/-/merge_requests/158/diffs) to not include external panel plugins by default. You can still add them yourself using the "Panel Preferences" dialog.

- `lib.packagesFromDirectoryRecursive` can now construct nested scopes matching the directory tree passed as input.
- [`lib.packagesFromDirectoryRecursive`] can now construct nested scopes matching the directory tree passed as input.

- GOverlay has been updated to 1.2, please check the [upstream changelog](https://github.com/benjamimgois/goverlay/releases) for more details.

Expand Down

0 comments on commit ee249ab

Please sign in to comment.