Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
Closes#376820
The issue with providing `moduleMakeFlags` via `passthru` of the kernel
package is that when this package gets overriden[1], the `moduleMakeFlags`
list still references the kernel without the overrides.
This broke e.g. kernel modules of linux-rpi4 which can be reproduced
with
nix-build --argstr system aarch64-linux -A linuxKernel.packages.linux_rpi4.zfs_2_3
This used to break with
Error: modDirVersion 6.6.51 specified in the Nix expression is wrong, it should be: 6.6.51-v8
since KBUILD_OUTPUT referenced the kernel without the changes from
`overrideDerivation` that also changes the `modDirVersion`.
The new approach is to add the build flags right into
`linuxKernel.packages.linux_X_Y`: that way we don't need any hacks to
update `moduleMakeFlags` when the derivation with the passthru gets
overridden.
By using the fixpoint of the package-set, the `kernelModuleMakeFlags`
list is correctly updated. E.g. given
with import ./. {};
linuxKernel.packages.linux_6_6.extend (self: super: {
kernel = super.kernel.overrideAttrs (_: {
name = "linux-snens";
});
})
the `makeFlags` is correctly updated:
$ nix-instantiate snenskek.nix -A zfs_2_3.makeFlags --eval --strict
[ "ARCH=x86_64" "CROSS_COMPILE=" "KBUILD_OUTPUT=/nix/store/gsp68549k1aqbwxwczpgw67w5jjn4shw-linux-snens-dev/lib/modules/6.6.74/build" ]
[1] E.g. `linux-rpi4`.
This is not needed for any regular usage, as folks will almost always
consume `linuxPackages.zfs*` via `boot.zfs.package = pkgs.zfs*`, where
that is the top-level package that has a reference to the appropriate
Kernel package via its `kernelModuleAttribute`. As such, this alias
provides little usefulness, so remove it to avoid having to maintain it
in-sync with the top-level alias.
The latest longterm kernel release series is 6.12, and we should roll it
out as the default now, to receive as much testing as possible before
the NixOS 25.05 release.
With the release of 2.3.0-rc, we know that 2.3.0 will be coming sometime
soon. Per the [ZFS release policy][1], only the current and previous
releases are expected to be supported, so 2.1.x will become unsupported.
Unfortunately upstream does not have any specific timelines, so we do
not know when it will become unsupported, but when it does we will
likely backport the removal. As such, begin warning of imminent removal.
[1]: 6187b19434/RELEASES.md