mobile-nixos icon indicating copy to clipboard operation
mobile-nixos copied to clipboard

Kernel Configuration

Open justinlovinger opened this issue 9 months ago • 7 comments

On regular NixOS, I never need to configure the kernel. However, on Mobile NixOS, I need to fork the project and manually edit config.aarch64 to enable some features, like NFS. Why is regular NixOS different? Can Mobile NixOS work the same as regular NixOS in this regard?

justinlovinger avatar May 04 '24 13:05 justinlovinger

Note, Bluetooth keyboards and mice do not work out-of-the-box on the latest NixOS unless you enable CONFIG_UHID, which is disabled in a number of the kernel-configurations in this repository.

justinlovinger avatar Jun 03 '24 10:06 justinlovinger

You don't have to fork the entire project. It is possible to leverage mobile.boot.stage-1.kernel.package option and override the kernel package. You may refer my configuration as an example.

codgician avatar Jun 23 '24 06:06 codgician

nixos-hardware recently added support for the Librem 5, and I noticed they were able to build its kernel with the standard NixOS builder, https://github.com/NixOS/nixos-hardware/blob/master/purism/librem/5r4/kernel.nix. That led me to investigate why Mobile NixOS uses a bespoke builder, and I noticed this interesting tidbit, "Many kernels will be of older vintages, not supported by NixOS' own kernel build infrastructure", https://github.com/NixOS/mobile-nixos/blob/development/overlay/mobile-nixos/kernel/builder.nix. I believe this is a holdover from before Mobile NixOS dropped support for non-mainline devices. We should be able to use the standard NixOS kernel-builder now.

justinlovinger avatar Jun 25 '24 14:06 justinlovinger

You're reading an historical note.

The current reason the builder infra builds a kernel "in this weird way" is because of the open question about dealing with kernel modules for a kernel booted outside of the lifecycle of generations.

samueldr avatar Jun 25 '24 18:06 samueldr

You're reading an historical note.

The note should probably be updated then.

The current reason the builder infra builds a kernel "in this weird way" is because of the open question about dealing with kernel modules for a kernel booted outside of the lifecycle of generations.

That still raises the question, why can the Librem 5 work without your kernel-builder? If your kernel-builder is not strictly necessary, it should not be required for using the devices supported by this project, especially given the issues it causes.

justinlovinger avatar Jun 25 '24 19:06 justinlovinger

Imagine this scenario:

  • User updates NixOS system
  • Kernel updates
  • Fails to boot

With the default setup, your device is toast until you figure out some tethered method to recover the device setup, since the kernel is managed within the lifecycle of generations, but without a way to select a generation.

This is what using the infra from Mobile NixOS allows.

In the end these are just Linux devices. You can use them however you like. You've never been forced to use Mobile NixOS.

especially given the issues it causes.

Easy to say when not understanding the issues it solves.

samueldr avatar Jun 25 '24 20:06 samueldr

Easy to say when not understanding the issues it solves.

I know this is a sensitive time for you, so I will scrap the longer response I wrote. Instead, I will simply say, as someone who has been daily-driving Mobile NixOS on my PinePhone for years, I disagree that the advantages of your kernel-builder outweigh the negatives.

justinlovinger avatar Jun 25 '24 20:06 justinlovinger