I’ve managed to get NixOS running on the Librem 5 with a kernel build from https://source.puri.sm/Librem5/linux.git
Biggest issue atm is that I do not have sound in calls due to callaudiod
segfaulting.
One of the minor issues that I have to run mkimage
by hand to update /boot/boot.scr
on configuration changes, to to boot into a new NixOS environment. It seems Purism u-boot does not support u-boot’s Generic Distro Configuration Concept which supports /boot/extlinux/ extlinux.conf
: https://u-boot.readthedocs.io/en/latest/develop/distro.html
The part in /etc/nixos/configuration.nix
that builds the Purism kernel is:
boot = {
initrd = {
kernelModules = [ "bq25891_charger" "dwc3" "imx_dcss" "imx_sdma" "mtdblock" "ofpart" "phy_fsl_imx8mq_usb" "snvs_pwrkey" "spi_nor" "tps6598x" "xhci_hcd" "usbcore" "usb_storage" "uas" "xhci_plat_hcd" ];
};
kernelParams = [ "console=tty0" "earlyprintk=vga" "ignore_loglevel" "rootwait" ];
loader = {
generic-extlinux-compatible.enable = true;
grub.enable = false;
};
kernelPackages = let
linux_librem5_pkg = { fetchgit, buildLinux, ... } @ args:
buildLinux (args // rec {
defconfig = "librem5_defconfig";
version = "6.1.6-librem5";
modDirVersion = version;
src = fetchgit {
url = "https://source.puri.sm/Librem5/linux.git";
hash = "sha256-EE6WHqgBmoRuZnbCPO3NrydOHPxG8G7lZXxDNm/2Kq4=";
};
kernelPatches = [];
} // (args.argsOverride or {}));
linux_librem5 = pkgs.callPackage linux_librem5_pkg{};
in
pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_librem5);
};