Skip to content

Commit 64de6c4

Browse files
committed
rl-2411: lib release notes
1 parent 1c30bec commit 64de6c4

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed

nixos/doc/manual/redirects.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,18 @@
18711871
"sec-release-24.11-wiki": [
18721872
"release-notes.html#sec-release-24.11-wiki"
18731873
],
1874+
"sec-release-24.11-lib": [
1875+
"release-notes.html#sec-release-24.11-lib"
1876+
],
1877+
"sec-release-24.11-lib-breaking": [
1878+
"release-notes.html#sec-release-24.11-lib-breaking"
1879+
],
1880+
"sec-release-24.11-lib-additions-improvements": [
1881+
"release-notes.html#sec-release-24.11-lib-additions-improvements"
1882+
],
1883+
"sec-release-24.11-lib-deprecations": [
1884+
"release-notes.html#sec-release-24.11-lib-deprecations"
1885+
],
18741886
"sec-release-24.05": [
18751887
"release-notes.html#sec-release-24.05"
18761888
],

nixos/doc/manual/release-notes/rl-2411.section.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,6 @@
797797
not the `hare` package, should be added to `nativeBuildInputs` when building
798798
Hare programs.
799799

800-
- [`lib.options.mkPackageOptionMD`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOptionMD) is now obsolete; use the identical [`lib.options.mkPackageOption`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOption) instead.
801-
802-
- `lib.misc.mapAttrsFlatten` is now formally deprecated and will be removed in future releases; use the identical [`lib.attrsets.mapAttrsToList`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.mapAttrsToList) instead.
803-
804800
- `virtualisation.docker.liveRestore` has been renamed to `virtualisation.docker.daemon.settings."live-restore"` and turned off by default for state versions of at least 24.11.
805801

806802
- Tailscale's `authKeyFile` can now have its corresponding parameters set through `config.services.tailscale.authKeyParameters`, allowing for non-ephemeral unsupervised deployment and more.
@@ -979,6 +975,57 @@ To provide some examples:
979975

980976
Note that this also allows writing overlays that explicitly apply to multiple boards.
981977

978+
## Nixpkgs Library {#sec-release-24.11-lib}
979+
980+
### Breaking changes {#sec-release-24.11-lib-breaking}
981+
982+
- [`lib.escapeShellArg`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.strings.escapeShellArg) and [`lib.escapeShellArgs`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.strings.escapeShellArgs): Arguments that don't need to be escaped won't be anymore, which is not breaking according to the functions documentation, but it can cause breakages if used for the non-intended use cases.
983+
- [`lib.warn msg val`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.warn) (and its relatives [`lib.warnIf`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.warnIf) and [`lib.warnIfNot`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.warnIfNot)) now require `msg` to be a string to match the behavior of the new [`builtins.warn`](https://nix.dev/manual/nix/2.25/language/builtins.html?highlight=warn#builtins-warn).
984+
- `lib.mdDoc`: Removed after deprecation in the previous release.
985+
986+
### Additions and Improvements {#sec-release-24.11-lib-additions-improvements}
987+
988+
New and extended interfaces:
989+
- [`lib.fromHexString`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.fromHexString): Convert a hexadecimal string to it's integer representation.
990+
- `lib.network.ipv6.fromString`: Parse an IPv6 address.
991+
- [`lib.getLicenseFromSpdxIdOr`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.getLicenseFromSpdxIdOr): Get the corresponding attribute in `lib.licenses` from an SPDX ID or fall back to the given default value.
992+
- [`lib.licensesSpdx`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.licensesSpdx): Mapping of SPDX ID to the attributes in `lib.licenses`.
993+
- [`lib.getFirstOutput`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.getFirstOutput): Like `getOutput` but with a list of fallback output names.
994+
- [`lib.getInclude`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.getInclude) and [`lib.getStatic`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.getStatic): Get a package’s `include`/`static` output.
995+
- [`lib.trim`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.strings.trim) and [`lib.trimWith`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.strings.trimWith): Remove leading and trailing whitespace from a string.
996+
- [`lib.meta.defaultPriority`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.defaultPriority): The default priority of packages in Nix.
997+
- [`lib.toExtension`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.fixedPoints.toExtension): Convert to an extending function (overlay).
998+
- `lib.fetchers.normalizeHash`: Convert an attrset containing one of `hash`, `sha256` or `sha512` into one containing `outputHash{,Algo}` as accepted by `mkDerivation`.
999+
- `lib.fetchers.withNormalizedHash`: Wraps a function which accepts `outputHash{,Algo}` into one which accepts `hash`, `sha256` or `sha512`.
1000+
- Various builtins are now reexported in a more standard way:
1001+
- `lib.map` -> `lib.lists.map` -> `builtins.map`
1002+
- `lib.intersectAttrs` -> `lib.attrsets.intersectAttrs` -> `builtins.intersectAttrs`
1003+
- `lib.removeAttrs` -> `lib.attrsets.removeAttrs` -> `builtins.removeAttrs`
1004+
- `lib.match` -> `lib.strings.match` -> `builtins.match`
1005+
- `lib.split` -> `lib.strings.split` -> `builtins.split`
1006+
- `lib.typeOf` -> `builtins.typeOf`
1007+
- `lib.unsafeGetAttrPos` -> `builtins.unsafeGetAttrPos`
1008+
- [`lib.cli.toGNUCommandLine`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.cli.toGNUCommandLine) now supports the `optionValueSeparator` argument attribute to control the key-value separator for arguments.
1009+
1010+
Documentation improvements:
1011+
- Much of the documentation has been migrated to the [standard doc-comment format](https://github.com/NixOS/rfcs/pull/145), including [`lib.derivations`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-derivations), [`lib.fixedPoints`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-fixedPoints), [`lib.gvariant`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-gvariant), [`lib.filesystem`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-filesystem), [`lib.strings`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-strings), [`lib.meta`](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-meta).
1012+
- [`lib.generators` documentation](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-generators) is now improved and rendered in the manual.
1013+
- [`lib.cli` documentation](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-cli) is now improved and rendered in the manual.
1014+
- [`lib.composeExtensions`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.fixedPoints.composeExtensions) and [`lib.composeManyExtensions`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.fixedPoints.composeManyExtensions) documentation is now improved.
1015+
- [`lib.importTOML`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.importTOML) and [`lib.importJSON`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.importJSON)'s documentation now have an example.
1016+
1017+
Module System:
1018+
- `lib.importApply`: New function, imports a Nix expression file much like the module system would, after passing an extra positional argument to the function in the file.
1019+
- Improve error message when accessing an option that isn't defined.
1020+
- `lib.types.anything`: Don't fail to merge when specifying the same list multiple times.
1021+
- Improve error when loading a flake as a module.
1022+
1023+
### Deprecations {#sec-release-24.11-lib-deprecations}
1024+
1025+
- [`lib.options.mkPackageOptionMD`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOptionMD) is now obsolete; use the identical [`lib.options.mkPackageOption`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.options.mkPackageOption) instead.
1026+
- `lib.misc.mapAttrsFlatten` is now formally deprecated and will be removed in future releases; use the identical [`lib.attrsets.mapAttrsToList`](https://nixos.org/manual/nixpkgs/unstable#function-library-lib.attrsets.mapAttrsToList) instead.
1027+
- `lib.isInOldestRelease`: Renamed to [`oldestSupportedReleaseIsAtLeast`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.oldestSupportedReleaseIsAtLeast) and deprecated.
1028+
9821029
## NixOS Wiki {#sec-release-24.11-wiki}
9831030

9841031
The official NixOS Wiki at [wiki.nixos.org](https://wiki.nixos.org/) was launched in April 2024, featuring

0 commit comments

Comments
 (0)