Skip to content

nixos: add opt-in J773g binary-kernel profile - #302

Closed
techmore wants to merge 4 commits into
aurora-silicon:mainfrom
techmore:techmore/j773g-nixos-upstream-v3-20261113
Closed

techmore wants to merge 4 commits into
aurora-silicon:mainfrom
techmore:techmore/j773g-nixos-upstream-v3-20261113

Conversation

@techmore

@techmore techmore commented Nov 13, 2026 •

Copy link
Copy Markdown

Summary

  • Add an opt-in aurora-j773g-kde configuration for the M4 Mac mini (J773g), with J773g-only kernel parameters, ESP handling, disabled sleep entry points, and PowerDevil defaults.
  • Package the pinned integration-0443-v2 (920ed134) Image, J773g DTB, modules archive, and resolved configuration with payload-digest, release, module-metadata, and reported-kernel-config checks.
  • Limit the Fedora-parity initrd assertions to the three generic installer configurations: aurora-kde, aurora-gnome, and aurora-minimal.

The J773g configuration is opt-in and does not change the three generic configurations. Its optional ESP mount and non-fatal apple_wdt modprobe are scoped to modules/j773g.nix; modules/image.nix and modules/firstboot.nix match main.

The shipped binary kernel is built without Rust (# CONFIG_RUST is not set) and without CONFIG_DRM_ASAHI. It has the Apple DCP display path but no Asahi GPU driver or GPU acceleration. This is an experimental bring-up profile, not a hardware-qualified KDE configuration.

Testing

  • On unsigned candidate da70fb8380278cb1f874d170319a8d71c013a578 (tree-equivalent to signed tip de28ee4b8f9cdbc0fbd5b5103370b27d42753f08), checks.aarch64-linux.fedora-parity.failures evaluates empty. The old head reproduces the four kde: failures from the red evaluate job.
  • system.build.toplevel.drvPath evaluates for aurora-kde, aurora-gnome, aurora-minimal, and aurora-j773g-kde.
  • All 18 check attributes built by CI's evaluate step, plus statix, deadnix, and documentation, evaluate to derivation paths.
  • The six J773g package/profile unit tests pass.

Hardware (receipt from 2026-11-14): we built the aurora-j773g-kde closure natively on aarch64 (a Linux guest on an Apple Silicon Mac mini, sandbox-fallback=false) from the unsigned candidate da70fb83, then booted it on a J773g (M4 Mac mini) as a one-shot GRUB entry from the machine's installed Stage 2. Each boot used the packaged 7.3.0-m4atlrx+ kernel (Image SHA-256 9b2f6aa0…), the profile's initrd and the exact toplevel init. The device tree in effect came from that Stage 2, not from the packaged DTB. The signed tip de28ee4b adds only the sign-off: each signed commit has the same tree as its unsigned counterpart, and nothing in the system graph reads the commit ID (self.rev appears only in docs/site.nix). Both tips therefore evaluate to the same toplevel derivation (vxmscaa9…), which two independent evaluations of da70fb83 confirmed. This identity rests on tree equality; the signed tip itself was not evaluated or booted separately.

All three counted boots reached graphical.target with a Plasma session (Plasma Login Manager, KWin, plasmashell) on HDMI through DCP, at 1920x1080 at 59 and 120 Hz. The following also worked:

  • NVMe boot and root mounts
  • USB (two xHCI controllers and a keyboard)
  • both CPU-frequency policies
  • apple_wdt (/dev/watchdog)
  • the ESP mount: the label timed out after 8 s without blocking the boot, as the profile's nofail intends

Does not work:

  • GPU acceleration. There is no Asahi driver and no render node; EGL/glamor and DRI2 setup fail, so the desktop runs without GPU rendering.
  • Wi-Fi. No Wi-Fi interface appears.

Not shown:

  • Ethernet link or IP (the Atlantic interface appears)
  • audio playback (DCP audio and PipeWire start)
  • thermal readings

The firewall and vendor-firmware units fail. The missing ESP label also leaves its fsck/mount and the dependent firstboot, Stage 2 commit, and secure-boot adoption jobs failed. All evidence comes from the boot journals; there are no display photos. Earlier attempts that modified init or added instrumentation were diagnostics and are not counted.

Not run on this head: GitHub CI, a native build of the checks, and a full nix flake check.

Dependencies

None.

Add a data-only package for the M4 Mac mini (J773g) kernel built from
techmore/linux j773g/integration-0443-20261112-v2 (920ed134a628): the
Image, J773g DTB, modules archive and resolved configuration. Nix does
not compile this kernel; the install phase verifies the three payload
digests, the kernel release string, the modules metadata and every
configuration value the package reports to linuxPackagesFor.

This configuration is built without Rust (# CONFIG_RUST is not set), so
the package reports RUST = "n" and does not include the Rust GPU driver.

The package is exposed as packages.aarch64-linux.j773g-binary-kernel and
is not selected by any existing configuration.

Assisted-by: OpenAI Codex
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The Fedora parity check asserts that each configuration's initrd carries
the generic loadable display, Type-C and audio drivers. It iterated over
every nixosConfigurations entry, so any hardware-specific configuration
whose kernel builds those drivers in, or which does not ship them, would
fail the generic assertions.

Name the three installer configurations explicitly: aurora-kde,
aurora-gnome and aurora-minimal. Their coverage is unchanged.

Assisted-by: OpenAI Codex
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Add nixosModules.j773g and an aurora-j773g-kde configuration that boots
the M4 Mac mini (J773g) with the packaged integration-0443-v2 binary
kernel. The generic configurations do not import this module.

The module:
- mounts the ESP by its AURORA_EFI label, non-fatal with a five-second
  device timeout;
- clears the initrd module lists (the NVMe, watchdog, btrfs, ext4 and
  vfat drivers needed to reach root are built in) and
  makes the initrd apple_wdt modprobe non-fatal;
- leaves cpufreq on the firmware-selected policy, since the binary
  package has no source tree to build cpupower from;
- applies the J773g kernel parameters, including disabling the USB4 and
  TBT3 paths of the Type-C controllers;
- disables suspend and hibernate entry points and sets PowerDevil
  defaults that never suspend, while sleep is not qualified on J773g.

The non-fatal ESP mount and modprobe apply only to this configuration;
modules/image.nix and modules/firstboot.nix are unchanged.

Assisted-by: OpenAI Codex
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@techmore
techmore force-pushed the techmore/j773g-nixos-upstream-v3-20261113 branch from 45721f9 to de28ee4 Compare November 14, 2026 19:29
@techmore

Copy link
Copy Markdown
Author

I rebased this branch onto main (f760f780) as three commits, made these fixes, and replaced the description to match the new head:

  • Kernel metadata. The packaged integration-0443-v2 config has # CONFIG_RUST is not set, but the package told linuxPackagesFor that RUST = "y". It now says "n". The install phase and a unit test now check every reported value against the shipped config, so the two can't drift apart again. This kernel has the Apple DCP display path but no Asahi GPU driver, so there is no GPU acceleration on this profile.
  • Scope. The earlier head made the /boot/efi mount nofail and the initrd apple_wdt modprobe non-fatal for every image. Both changes now live only in modules/j773g.nix. modules/image.nix and modules/firstboot.nix match main again, so the three generic configurations see no runtime change.
  • evaluate failure. The Fedora parity check applied the generic initrd-module assertions to aurora-j773g-kde, whose initrd module list is empty. The check now names aurora-kde, aurora-gnome and aurora-minimal explicitly. Trade-off: a future generic configuration is covered only once it is added to that list.

Evaluated on an x86_64 host with Nix 2.18, one attribute at a time:

  • checks.aarch64-linux.fedora-parity.failures is empty on this head (the builder fails only when it is non-empty). On the old head it reproduces the four kde: failures from the red run.
  • system.build.toplevel.drvPath evaluates for all four configurations. The generic configurations keep the fatal modprobe and ["defaults"] ESP options.
  • drvPath evaluates for every checks.aarch64-linux attribute that CI's evaluate step builds.
  • The six J773g unit tests pass.

Not done: GitHub CI on this head, a native build of the checks, and a full nix flake check.

Hardware (receipt from 2026-11-14): we built the aurora-j773g-kde closure natively on aarch64 (a Linux guest on an Apple Silicon Mac mini, sandbox-fallback=false) from the unsigned candidate da70fb83, then booted it on a J773g (M4 Mac mini) as a one-shot GRUB entry from the machine's installed Stage 2. Each boot used the packaged 7.3.0-m4atlrx+ kernel (Image SHA-256 9b2f6aa0…), the profile's initrd and the exact toplevel init. The device tree in effect came from that Stage 2, not from the packaged DTB. The signed tip de28ee4b adds only the sign-off: each signed commit has the same tree as its unsigned counterpart, and nothing in the system graph reads the commit ID (self.rev appears only in docs/site.nix). Both tips therefore evaluate to the same toplevel derivation (vxmscaa9…), which two independent evaluations of da70fb83 confirmed. This identity rests on tree equality; the signed tip itself was not evaluated or booted separately.

All three counted boots reached graphical.target with a Plasma session (Plasma Login Manager, KWin, plasmashell) on HDMI through DCP, at 1920x1080 at 59 and 120 Hz. The following also worked:

  • NVMe boot and root mounts
  • USB (two xHCI controllers and a keyboard)
  • both CPU-frequency policies
  • apple_wdt (/dev/watchdog)
  • the ESP mount: the label timed out after 8 s without blocking the boot, as the profile's nofail intends

Does not work:

  • GPU acceleration. There is no Asahi driver and no render node; EGL/glamor and DRI2 setup fail, so the desktop runs without GPU rendering.
  • Wi-Fi. No Wi-Fi interface appears.

Not shown:

  • Ethernet link or IP (the Atlantic interface appears)
  • audio playback (DCP audio and PipeWire start)
  • thermal readings

The firewall and vendor-firmware units fail. The missing ESP label also leaves its fsck/mount and the dependent firstboot, Stage 2 commit, and secure-boot adoption jobs failed. All evidence comes from the boot journals; there are no display photos. Earlier attempts that modified init or added instrumentation were diagnostics and are not counted.

The hardware matrix passes every package name through prefetch-sources.py before building it. The J773g binary kernel keeps all of its verified payloads in this repository, so record it as a package with no external archives and cover that selection in the prefetch tests.

Assisted-by: OpenAI Codex
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@techmore

Copy link
Copy Markdown
Author

Fixed the failing j773g-binary-kernel hardware job: the vendored package was missing from prefetch-sources.py's no-archive map. The exact failing prefetch command and 12 focused tests pass locally; evaluate is green. Nix is not installed on this MacBook, so I could not run the subsequent aarch64-linux build locally.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J773g bring-up work and the detailed boot receipt; it is good to see Plasma on DCP on the Mac mini.

We can't take this shape into the distribution, though. The project keeps one kernel build for every Mac and does not ship per-board kernels or rely on kernel command-line switches to make a machine work. This PR adds:

  • packages/j773g-binary-kernel.nix and packages/j773g-kernel/integration-0443-v2/{Image,config,modules.tar.gz}: a separate prebuilt kernel and config for one board
  • modules/j773g.nix:19-32: ctxr_exec_enforce=0, sn201202x.j773g_no_usb4=1, sn201202x.j773g_no_tbt3=1, nvme_apple.flush_interval=0, pd_ignore_unused, clk_ignore_unused as required parameters

Each of those should become a kernel driver default selected by the hardware it applies to (the USB4/TBT block, the NVMe controller, the power domains in the device tree), landed in aurora-silicon/linux so the shared kernel package boots the J773g. The sleep/PowerDevil overrides could stay as a documented testing profile if needed.

Happy to help split this into those kernel changes, and we can run rows on our M1 Pro, M2, M4 Pro and A18 Pro.

@techmore

Copy link
Copy Markdown
Author

Closing. With aurora-silicon/linux#2317 the shared kernel boots the J773g (27.2 stub) with none of these parameters: two boots, five minutes each, execmem enforcing, unused clocks and domains disabled. No per-board kernel or required command-line switch is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants