Home Explore Blog CI



nixpkgs

26th chunk of `nixos/doc/manual/release-notes/rl-2411.section.md`
a0afd3a907d394277ac9c9cd9c1e547f3fc8e8193f5662340000000100001044
    { keys = [ 115 ]; events = [ "key" "rep" ]; command = "${alsa-utils}/bin/amixer -q set Master ${volumeStep}+ unmute"; }

    # "Mic Mute" media key
    { keys = [ 190 ]; events = [ "key" ];       command = "${alsa-utils}/bin/amixer -q set Capture toggle"; }
  ];
};
```

### `hardware.deviceTree.overlays` compatible string matching {#sec-release-24.11-migration-dto-compatible}

The original compatible string implementation in older NixOS versions relied on substring matching,
which is incorrect for overlays with multiple compatible strings and other cases.

The new behavior is consistent with what other tools already do - the overlay is considered applicable if,
and only if, _any_ of the compatible strings in the overlay match _any_ of the compatible strings in the DT.

To provide some examples:

| Overlay `compatible` | DT `compatible` | Pre-24.11 behavior | Correct behavior | Notes                                      |
|----------------------|-----------------|--------------------|------------------|--------------------------------------------|
| `"foo"`              | `"foo", "bar"`  | match              | match            | Most common use case does not change       |
| `"foo"`              | `"foobar"`      | match              | no match         | Substrings should not be matched           |
| `"foo bar"`          | `"foo", "bar"`  | match              | no match         | Separators should not be matched to spaces |
| `"foo", "bar"`       | `"baz", "bar"`  | no match           | match            | One compatible string matching is enough   |

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

## Nixpkgs Library {#sec-release-24.11-lib}

### Breaking changes {#sec-release-24.11-lib-breaking}

- [`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.
- [`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).
- `lib.mdDoc`: Removed after deprecation in the previous release.

### Additions and Improvements {#sec-release-24.11-lib-additions-improvements}

New and extended interfaces:
- [`lib.fromHexString`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.trivial.fromHexString): Convert a hexadecimal string to it's integer representation.
- `lib.network.ipv6.fromString`: Parse an IPv6 address.
- [`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.
- [`lib.licensesSpdx`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.meta.licensesSpdx): Mapping of SPDX ID to the attributes in `lib.licenses`.
- [`lib.getFirstOutput`](https://nixos.org/manual/nixpkgs/unstable/#function-library-lib.attrsets.getFirstOutput): Like `getOutput` but with a list of fallback output names.
- [`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.
- [`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.

Title: NixOS 24.11: Device Tree Overlays and Nixpkgs Library Updates
Summary
This section discusses changes to `hardware.deviceTree.overlays` compatible string matching in NixOS 24.11, emphasizing the correct behavior for applying overlays. It also details breaking changes and improvements to the Nixpkgs library, including updates to `lib.escapeShellArg`, `lib.warn`, and the removal of `lib.mdDoc`. The section highlights new and extended interfaces such as `lib.fromHexString`, `lib.network.ipv6.fromString`, `lib.getLicenseFromSpdxIdOr`, and others, providing developers with enhanced functionality and tools.