I’ve added a new platform to lib.systems.examples
:
final: prev: {
lib = prev.lib.extend (finalLib: prevLib: {
systems = finalLib.recursiveUpdate ({
examples.mipsel-none-elf = { config = "mipsel-none-elf"; } // finalLib.systems.platforms.gcc_mips32r2_o32;
}) prevLib.systems;
});
}
…but it was only after I got that working that I realised /pkgs/top-level/stage.nix
(where pkgsCross
is defined) isn’t affected by overlays -_-
How do I add to pkgsCross
, or otherwise transform a full packageset into a packageset for a specific target platform?
nixpkgsFun
isn’t exposed so you’ll just have to import pkgs.path
with the config and overlays(pkgs.overlays
) you want to use
That does seem to get the correct values for host and build into mkDerivation
.
# { pkgs, ... }:
let
systems = lib.recursiveUpdate {
examples.mipsel-none-elf = { config = "mipsel-none-elf"; } // lib.systems.platforms.gcc_mips32r2_o32;
} lib.systems;
pkgsPSX = import (pkgs.path) {
inherit (pkgs) config overlays;
crossSystem = systems.examples.mipsel-none-elf;
};
in {
PSn00bSDK = pkgsPSX.callPackage ./PSn00bSDK { inherit systems; };
}
{ lib
, systems
, stdenv
, fetchFromGitHub
, cmake
, ninja
}:
stdenv.mkDerivation {
pname = "PSn00bSDK";
version = "0.24";
src = /*...*/;
nativeBuildInputs = [ cmake ninja ];
meta.platforms = [ lib.systems.inspect.patterns.isMips32 ]; #TODO use systems.examples.mipsel-none-elf here for correctness
}
(Now I’m struggling to find flags which will make the package compile but that’s a separate issue.)