{ arches, libkernel, nixpkgs, pkgs, python, system, }: let mkKernel = path: let args = import path; arch = arches.${args.vernos-arch}; libkernel-arch = libkernel.${args.vernos-arch}; pkgs-arch = import nixpkgs { inherit system; crossSystem.config = arch.crossSystem; }; in pkgs-arch.stdenvNoCC.mkDerivation ( { pname = "vernos-kernel-${args.vernos-board}"; version = libkernel-arch.version; nativeBuildInputs = [ pkgs.ninja pkgs-arch.stdenv.cc.bintools.bintools python ]; dontUnpack = true; configurePhase = '' runHook preConfigure python3 ${./configure.py} ${args.vernos-arch} ${args.vernos-board} \ ${libkernel-arch} $src runHook postConfigure ''; installPhase = '' runHook preInstall install -m0755 -Dt $out vernos_kernel.elf install -m0644 -Dt $out vernos_kernel.sym runHook postInstall ''; dontFixup = true; AS = "${arch.crossSystem}-as"; LD = "${arch.crossSystem}-ld"; STRIP = "${arch.crossSystem}-strip"; } // args ); in nixpkgs.lib.recurseIntoAttrs { qemu-virt = mkKernel ./qemu-virt; }