{ arches, fenix, nixpkgs, system, }: let toml = builtins.fromTOML (builtins.readFile ./kernel/Cargo.toml); mkLibKernel = _: { crossSystem, rust-target }: let pkgs = import nixpkgs { inherit system; crossSystem.config = crossSystem; }; rust-toolchain = fenix.combine [ fenix.stable.cargo fenix.stable.rustc fenix.stable.clippy fenix.targets.${rust-target}.stable.rust-std ]; rust = pkgs.makeRustPlatform { cargo = rust-toolchain; rustc = rust-toolchain; }; in rust.buildRustPackage { pname = toml.package.name; version = toml.package.version; src = ./.; cargoLock.lockFile = ./Cargo.lock; dontFixup = true; }; in nixpkgs.lib.recurseIntoAttrs (builtins.mapAttrs mkLibKernel arches)