{ config, pkgs, modulesPath, ... }: let firmware = pkgs.callPackage ./firmware.nix { }; in { imports = [ "${modulesPath}/profiles/base.nix" "${modulesPath}/installer/sd-card/sd-image.nix" ./. ]; sdImage = { imageName = "${config.sdImage.imageBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}-starfive-visionfive2.img"; # Overridden by postBuildCommands populateFirmwareCommands = ""; firmwarePartitionOffset = 4; firmwareSize = 4; postBuildCommands = '' # preserve root partition eval $(partx $img -o START,SECTORS --nr 2 --pairs) # increase image size for gpt backup header truncate -s '+2M' $img sfdisk $img <