This is an unofficial installation configuration of NixOS 22.05 for the Hardkernel ODROID HC4 microcomputer.
The recommended usage is to import this repository as a nix flake
Enable aarch64
emulation for the host system:
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
Create a flake.nix with the following content:
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
inputs.nixos-odroidhc4.url = "github:considerate/nixos-odroidhc4/release-22.05";
outputs = inputs: {
packages.aarch64-linux = {
uboot = inputs.nixos-odroidhc4.packages.aarch64-linux.uboot-odroid-hc4;
sd-image = inputs.self.nixosConfigurations.nixos-hc4.config.system.build.sdImage;
};
nixosConfigurations = {
nixos-hc4 = inputs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = [
inputs.nixos-odroidhc4.nixosModules.odroidhc4
# add your own modules here...
];
};
};
};
}
Build the SD image by running:
$ nix build .#packages.aarch64-linux.sd-image
Copy the built image to an SD-card with:
# dd if=result/sd-image/nixos-sd-image-*-aarch64-linux.img of=/dev/<DEVICE> status=progress bs=512K
Add the U-boot boot loader to the SD-card by building and running
$ nix build .#packages.aarch64-linux.uboot
$ ./result/sd_fusing.sh /dev/<DEVICE>