Cannot update kernel to pkgs.linuxPackages_latest

When I try to set boot.kernelPackages with pkgs.linuxPackages_latest, I am getting the following error

error: Cannot build '/nix/store/22xyb1vkwzi3bxhpms82h5rkysgbd7sf-linux-6.18.2-modules-shrunk.drv'.                                                                                                                                                                            
       Reason: builder failed with exit code 1.                                                                                                                                                                                                                               
       Output paths:                                                                                                                                                                                                                                                          
         /nix/store/2r7h3qxk1bkvp6isi33813jkq0r4zbkc-linux-6.18.2-modules-shrunk                                                                                                                                                                                              
       Last 25 log lines:                                                                                                                                                                                                                                                     
       >   builtin dependency: ehci_hcd                                                                                                                                                                                                                                       
       > root module: ehci_pci                                                                                                                                                                                                                                                
       >   builtin dependency: ehci_pci                                                                                                                                                                                                                                       
       > root module: hid_apple                                                                                                                                                                                                                                               
       >   builtin dependency: hid_apple                                                                                                                                                                                                                                      
       > root module: hid_cherry                                                                                                                                                                                                                                              
       >   builtin dependency: hid_cherry                                                                                                                                                                                                                                     
       > root module: hid_corsair                                                                                                                                                                                                                                             
       >   copying dependency: /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2/kernel/drivers/hid/hid-corsair.ko.xz                                                                                                                       
       > root module: hid_generic                                                                                                                                                                                                                                             
       >   builtin dependency: hid_generic                                                                                                                                                                                                                                    
       > root module: hid_lenovo                                                                                                                                                                                                                                              
       >   copying dependency: /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2/kernel/drivers/hid/hid-lenovo.ko.xz
       > root module: hid_logitech_dj
       >   copying dependency: /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2/kernel/drivers/hid/hid-logitech-dj.ko.xz
       > root module: hid_logitech_hidpp
       >   copying dependency: /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2/kernel/drivers/hid/hid-logitech-hidpp.ko.xz
       > root module: hid_microsoft
       >   builtin dependency: hid_microsoft
       > root module: hid_roccat
       >   copying dependency: /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2/kernel/drivers/hid/hid-roccat.ko.xz
       > root module: input_leds
       >   builtin dependency: input_leds
       > root module: ip6_tables
       > modprobe: FATAL: Module ip6_tables not found in directory /nix/store/1vj9vva8jh1rbqcls8pv9qjh3j7l6cw4-linux-6.18.2-modules/lib/modules/6.18.2
       For full logs, run:
         nix log /nix/store/22xyb1vkwzi3bxhpms82h5rkysgbd7sf-linux-6.18.2-modules-shrunk.drv
error: Cannot build '/nix/store/dcgq5s5v5yppj5plc5ap3cwpr646iqh8-initrd-linux-6.18.2.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/k2yd67rn1j37snsfy4749qkzwl3rx10r-initrd-linux-6.18.2
error: Cannot build '/nix/store/b778qgj5yb1nja7bwbcgablmrs3jfmzg-nixos-system-turing-beta-25.11.20251220.b3aad46.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/7rhp9gx0m5bs7na6inygj09x80hgw1gs-nixos-system-turing-beta-25.11.20251220.b3aad46

here is the setting

    # Use systemd-boot
    boot.loader = {   
      grub.enable = false;
      generic-extlinux-compatible.enable = false;
      systemd-boot.enable = true;                
      efi.canTouchEfiVariables = false;          
      efi.efiSysMountPoint = "/boot";  
    };                                 
                                     
    boot.kernelPackages = pkgs.linuxPackages_latest;
                                                    
    boot.initrd.availableKernelModules = [          
      # Load modules needed for xchacha20,aes-adiantum-plain64
      "adiantum" "xchacha20" "aes" "nhpoly1305"               
                                                              
      # Load modules needed for vfat           
      "nls_iso8859_1"               
     ];  

Also I am using the following setting so that I can ssh with tailscale on boot

It seems some Kernel module is not compatible with the latest kernel. The actual error is missing from the part you pasted. Run

for the actual error.

1 Like

I replaced the config for initrd-tailscale with the following

I am already using systemd for stage 1 so might as well replaced the old config with above.

I works perfectly on my system.