How to get a NixOs image with newer kernel?


I am new to Nix and wanted to install NixOs on my new Laptop.

The problem I have is: this laptop comes with an Intel Wi-Fi 6 AX210/AX211/AX411 160MHz card that is only supported by kernel 5.12 and newer.

The current image to install comes with kernel 5.10, so I don’t have internet access during the installation.

Wired Ethernet is not an option to me, as this laptop does not have an ethernet port. It is my new work computer, so I can’t complain.

How can I get a nixos image with a newer kernel?

And, how often the kernel packages are updated on Nixos?

Thanks in advance!


You can basically build your own image provided that you already have a machine with NixOS. Could be a VM, too.

You can also set boot.kernelPackages = pkgs.linuxPackages_latest; in your configuration.nix, which should give you fairly recent kernel packages if I am not mistaken. Like I myself am on kernel 5.16.0 right now.

Edit: if you have a phone, connect it to your wifi and setup tethering via usb cable. Then you can enable the newest kernel packages after the installation.

1 Like

You need to set boot.kernelPackages to a newer Linux version, for instance, pkgs.linuxPackages_latest.

{ pkgs, lib, config }:
  boot.kernelPackages = pkgs.linuxPackages_latest;
1 Like

You can download an iso with a newer kernel (5.15 I guess) from Hydra if you’d like to use WiFi during install: Hydra - nixos:release-21.11:nixos.iso_minimal_new_kernel.x86_64-linux

Then proceed as usual and set boot.kernelPackages = pkgs.linuxPackages_latest in your config as described above.

Unfortunately these isos aren’t listed on the home page and Hydra is notoriously hard to navigate…


Do you have a link to where I can learn to do this? sounds like the best approach now.

So, what I need to do is then:

  • get a Nixos VM
  • update the kernel, as explained above
  • turn that into a new image
  • boot the new image in the laptop and be happy

Is this correct?

This sounds great! I will try that before building my own Nixos image.

Is there a guide on how to navigate Hydra?

1 Like

I’m afraid Hydra is, like many other parts of NixOS, underdocumented. You can take a look at the wiki which links to the manual as well but it’s mostly about running Hydra and not at all that useful from a simple user perspective.

To complicate matters even further, other shortcomings make the search at the top right basically useless - it’s quite likely to timeout (see: search feature often times out and results in error 500 · Issue #901 · NixOS/hydra · GitHub).

The only advice I can offer is to describe how I located that iso: navigate to Hydranixosrelease-21.11Jobs tab → search for iso\_.

For slightly different use cases - e.g. if you’re just looking for a package or configuration option I recommend using which works really well for that purpose.

1 Like

I downloaded the ISO from the link you found in Hydra and it contains a kernel 5.15 :slight_smile:

I can see the wifi card in lspci and ip a shows the device now :slight_smile:

wpa_cli followed by scan does not show any network… but wpa_cli -i wlp61s0 solved the case. This question is a bit off topic, but: what is the recommended way to improve the docs with this detail?

Thanks @APCodes, @schuelermine, and @ ius! I will now try to install Nixos and use your suggestion for latest kerne:)

1 Like