Skip to content

Raspberry Pi 4 Linux Kernel with PREEMPT_RT for NixOS

Notifications You must be signed in to change notification settings

mattywillo/linux_rpi4_rt-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi 4 PREEMPT_RT Kernel for NixOS

This flake provides packages to build the Raspberry Pi supplied kernel with PREEMPT_RT enabled.

Usage

Add the overlay and set boot.kernelPackages to pkgs.linuxPackages_rpi4_rt

An example flake based system config with boot.loader.raspberryPi and nixos-hardware:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    nixos-hardware.url = "github:NixOS/nixos-hardware";
    rpi4_rt.url = "github:mattywillo/linux_rpi4_rt-nix";
  };
  outputs = { self, nixpkgs, nixos-hardware, rpi4_rt }: {
    nixosConfigurations.rpi = nixpkgs.lib.nixosSystem {
      modules = [ 
        ({pkgs, lib, ...}: { 
          nixpkgs.overlays = [ rpi4_rt.overlay ]; 
          
          imports = [
            ./hardware-configuration.nix
            nixos-hardware.nixosModules.raspberry-pi-4
          ];

          boot.kernelPackages = pkgs.linux_rpi4_rt.linuxPackages;

          boot.loader.grub.enable = false;
          boot.loader.grub.device = "nodev";

          # Recent NixOS versions enforce uniqueness on installBootLoader
          # making nixos-hardware.raspberry-pi-4' and 'boot.loader.raspberryPi'
          # conflict, this line prevents nixos-hardware setting the bootloader
          boot.loader.generic-extlinux-compatible.enable = lib.mkForce false;

          boot.loader.raspberryPi.enable = true;
          boot.loader.raspberryPi.version = 4;
          
          #...regular system configuration...
        }) 
      ];
    };
  };
}

About

Raspberry Pi 4 Linux Kernel with PREEMPT_RT for NixOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages