Open pablohirafuji opened 9 months ago
@pablohirafuji did you get this going?
I'm struggling with understanding how it's supposed to build, feel like the instructions are missing something.
Perhaps there was a repo with more commits at forgejo (mentioned in the project description), but it appears to be toast now.
@Arcayr can you advise if there's more that we're missing?
interestingly i didn't get a notif when the issue was opened, sorry gang.
i've since left the nix ecosystem, however the last time i used it, i had the following in flake.nix
, in my inputs:
# orange pi sanity saving apparatus.
opiz3-nix = {
url = "github:arcayr/orangepizero3-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
the overlay from this flake is then added to the nixpkgs
of the host i was using it on:
nixpkgs = {
config = {
allowUnfree = true;
};
overlays = [
inputs.opiz3-nix.overlays.pkgs;
];
};
and the following in the configuration for the board:
nixpkgs.hostPlatform = "aarch64-linux";
# dodge "module ahci not found" error for socs.
hardware.enableRedistributableFirmware = false;
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
# u-boot, no grub, no efi.
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.efi.canTouchEfiVariables = false;
# slim supported filesystems.
boot.supportedFilesystems = pkgs.lib.mkForce ["vfat" "ext4"];
boot.initrd.supportedFilesystems = pkgs.lib.mkForce ["vfat" "ext4"];
# opi z3 custom kernel.
# TODO: move to mainline 6.6 when released.
boot.kernelPackages = let
crossPkgs = import pkgs.path { # force cross-compile from x86_64.
localSystem.system = "x86_64-linux";
crossSystem.system = "aarch64-linux";
}; in crossPkgs.linuxPackagesFor pkgs.linuxOrangePiZero3; # this comes in via the orangepizero3-nix flake, from its package - https://github.com/Arcayr/orangepizero3-nix/blob/main/flake.nix#L15
# opi needs the uboot image written to a specific part of the firmware.
sdImage.postBuildCommands = ''dd if=${pkgs.ubootOrangePiZero3}/u-boot-sunxi-with-spl.bin of=$img bs=8 seek=1024 conv=notrunc'';
# this gets burned straight onto an sd. no point in zstd.
sdImage.compressImage = false;
the above is all from memory so it might be a little bit off, apologies if so.
i believe linux 6.6+ actually supports this board in mainline, so you may be able to simply use upstream now. i'd recommend chatting to the people in the nixos on arm channel on matrix for information on the intricacies of compiling custom kernels for aarch64; they are very helpful.
forgejo is actually coming back today, i am right in the middle of migrating it from vultr to fly.io :)
if you're compiling from an aarch64 laptop (e.g., an m* macbook) you may need to remove this part from the board config:
crossPkgs = import pkgs.path { # force cross-compile from x86_64.
localSystem.system = "x86_64-linux";
crossSystem.system = "aarch64-linux";
}; in crossPkgs.linuxPackagesFor pkgs.linuxOrangePiZero3;
and replace it with
pkgs.linuxPackagesFor pkgs.linuxOrangePiZero3;
@deftdawg No, I was not able to make it work. I didn't test with the new instructions tho.
@Arcayr Thanks for the detailed instructions, I will try when I have the time.
Hey, thank you for sharing your configuration.
I'm trying to build an image to use on my own orange pi zero 3 and I can't get it to work. Mainly this line of the example:
I tried using directly from the flake:
But it gives me this error:
I've also tried using
pkgs.linuxPackagesFor opiz3-nix.packages.aarch64-linux.linuxOrangePiZero3
with no success. Can you give me an example on how to setup thepkgs.orangePiZero3
overlay?