{ 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 -Dt $out kernel.elf runHook postInstall ''; AS = "${arch.crossSystem}-as"; LD = "${arch.crossSystem}-ld"; } // args ); in nixpkgs.lib.recurseIntoAttrs { qemu-virt = mkKernel ./qemu-virt; }