Skip to content

Commit 33cca92

Browse files
authored
rl-2411: lib release notes (#359887)
2 parents 96a8336 + 64de6c4 commit 33cca92

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.
@@ -977,6 +973,57 @@ To provide some examples:
977973

978974
Note that this also allows writing overlays that explicitly apply to multiple boards.
979975

976+
## Nixpkgs Library {#sec-release-24.11-lib}
977+
978+
### Breaking changes {#sec-release-24.11-lib-breaking}
979+
980+
- [`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.
981+
- [`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).
982+
- `lib.mdDoc`: Removed after deprecation in the previous release.
983+
984+
### Additions and Improvements {#sec-release-24.11-lib-additions-improvements}
985+
986+
New and extended interfaces:
987+
- [`lib.fromHexString`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.fromHexString): Convert a hexadecimal string to it's integer representation.
988+
- `lib.network.ipv6.fromString`: Parse an IPv6 address.
989+
- [`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.
990+
- [`lib.licensesSpdx`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.licensesSpdx): Mapping of SPDX ID to the attributes in `lib.licenses`.
991+
- [`lib.getFirstOutput`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.getFirstOutput): Like `getOutput` but with a list of fallback output names.
992+
- [`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.
993+
- [`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.
994+
- [`lib.meta.defaultPriority`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.defaultPriority): The default priority of packages in Nix.
995+
- [`lib.toExtension`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.fixedPoints.toExtension): Convert to an extending function (overlay).
996+
- `lib.fetchers.normalizeHash`: Convert an attrset containing one of `hash`, `sha256` or `sha512` into one containing `outputHash{,Algo}` as accepted by `mkDerivation`.
997+
- `lib.fetchers.withNormalizedHash`: Wraps a function which accepts `outputHash{,Algo}` into one which accepts `hash`, `sha256` or `sha512`.
998+
- Various builtins are now reexported in a more standard way:
999+
- `lib.map` -> `lib.lists.map` -> `builtins.map`
1000+
- `lib.intersectAttrs` -> `lib.attrsets.intersectAttrs` -> `builtins.intersectAttrs`
1001+
- `lib.removeAttrs` -> `lib.attrsets.removeAttrs` -> `builtins.removeAttrs`
1002+
- `lib.match` -> `lib.strings.match` -> `builtins.match`
1003+
- `lib.split` -> `lib.strings.split` -> `builtins.split`
1004+
- `lib.typeOf` -> `builtins.typeOf`
1005+
- `lib.unsafeGetAttrPos` -> `builtins.unsafeGetAttrPos`
1006+
- [`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.
1007+
1008+
Documentation improvements:
1009+
- 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).
1010+
- [`lib.generators` documentation](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-generators) is now improved and rendered in the manual.
1011+
- [`lib.cli` documentation](https://nixos.org/manual/nixpkgs/unstable/#sec-functions-library-cli) is now improved and rendered in the manual.
1012+
- [`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.
1013+
- [`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.
1014+
1015+
Module System:
1016+
- `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.
1017+
- Improve error message when accessing an option that isn't defined.
1018+
- `lib.types.anything`: Don't fail to merge when specifying the same list multiple times.
1019+
- Improve error when loading a flake as a module.
1020+
1021+
### Deprecations {#sec-release-24.11-lib-deprecations}
1022+
1023+
- [`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.
1024+
- `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.
1025+
- `lib.isInOldestRelease`: Renamed to [`oldestSupportedReleaseIsAtLeast`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.oldestSupportedReleaseIsAtLeast) and deprecated.
1026+
9801027
## NixOS Wiki {#sec-release-24.11-wiki}
9811028

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

0 commit comments

Comments
 (0)