List item I have tried manually building a NixOS image by formatting, mounting, nixos-generate-config, tweak, and nixos-install.
List item I have been running Ubuntu 64-bit for more than a year on this unit. It uses an ADATA SP550 240 GB SSD connected via a StarTech USB3S2SAT3CB adapter for storage.
List item rpi-eeprom-update reports the latest firmwares:
BOOTLOADER: up to date
CURRENT: Tue Jan 25 02:30:41 PM UTC 2022 (1643121041)
LATEST: Tue Jan 25 02:30:41 PM UTC 2022 (1643121041)
RELEASE: default (/nix/store/kamvn40ksgr3cpivvbxbkp926mi9x7az-raspberrypi-eeprom-unstable-2022-03-10/share/rpi-eeprom/default)
Use raspi-config to change the release.
VL805_FW: Dedicated VL805 EEPROM
VL805: up to date
CURRENT: 000138a1
LATEST: 000138a1
List item The configuration.nix file I’ve been using:
{ config, pkgs, lib, ... }:
let
user = "matt";
password = "********";
hostname = "berry";
in {
imports =
[
./hardware-configuration.nix # Include the results of the hardware scan.
"${fetchTarball "https://github.com/NixOS/nixos-hardware/archive/936e4649098d6a5e0762058cb7687be1b2d90550.tar.gz" }/raspberry-pi/4"
];
system.stateVersion = "22.05";
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" "uas" "usb_storage" ];
networking = {
hostName = hostname;
wireless.enable = false;
};
time.timeZone = "America/New_York";
environment.systemPackages = with pkgs; [
vim
wget
zstd
];
services.openssh = {
enable = true;
};
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
password = password;
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
};
};
}
Hey there!
Looking at the output of your first code snippet:
This is UBOOT Output, which is the Bootloader of RPI4 that starts from hardware eeprom before the NixOS bootloader even gets loaded.
So probably no amount of tweaking in the NixOS config will fix that issue for you.
I just installed NixOS on my RPI4B, it was a bumpy ride
My guess would be that this is one of the infamous USB boot bugs described here:
One thing you could try which fixed my boot generation reset bug (different issue you will encounter after you have solved this one ) is including all-hardware in your config like so:
Thanks for the future tip! Yes, I was assuming that u-boot is most of the files in /boot of the SD image. Weirdly, when I manually created my SSD image I had to copy those from the SD card image since Nix didn’t create them when I built the SSD image from the configuration.nix. It put other stuff in the /boot folder, but not the u-boot files. This of course got me examining the difference between the u-boot files supplied by NixOS and Ubuntu. There’s a lot in common, so maybe the issue is that NixOS’s u-boot files are from a different fork of u-boot than Ubuntu (https://elinux.org/RPi_U-Boot). My next step is to see if I can find the NixPkg for u-boot and the one from Ubuntu.
It might also be helpful to know if there is anything I could put in the /boot/config.txt that would enable more granular error messages.
Including all-hardware into the config (see above)
I can also recommend this repo as a starting point, my config bases off of that but is not USB booted, maybe it works for you.
Regarding the general USB Boot issue I have also found this PR which was sent to me by someone at nix-bitcoin. This is not required if you have all-hardware imported though
Actually, I just got the unit to boot from the SSD! I switched from u-boot to UEFI booting. I’m working on tidying up my notes so I can post them here and in the github issue to which you linked.