feat(third_party/nixpkgs): allow setting crossSystem

This allows cross-compiling depot targets to other architectures, so
`nix-build --argstr crossSystem aarch64-linux -A tvix.nar-bridge`
will emit a cross-compiled aarch64-linux binary.

There's still some other cross-related issues in crate2nix to sort out
for crate2nix builds, but this CL can already land.

Co-Authored-By: raitobezarius <tvl@lahfa.xyz>
Change-Id: I467d49d125dd707a4142bfde18eea4a1c3afaf70
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9755
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2023-10-16 14:29:56 +01:00 committed by flokli
parent 71fa4110fa
commit 18d582f96b
2 changed files with 4 additions and 2 deletions

View file

@ -6,6 +6,7 @@
, parentTargetMap ? null , parentTargetMap ? null
, nixpkgsConfig ? { } , nixpkgsConfig ? { }
, localSystem ? builtins.currentSystem , localSystem ? builtins.currentSystem
, crossSystem ? null
, ... , ...
}@args: }@args:
@ -78,7 +79,7 @@ let
in in
readTree.fix (self: (readDepot { readTree.fix (self: (readDepot {
inherit localSystem; inherit localSystem crossSystem;
depot = self; depot = self;
# Pass third_party as 'pkgs' (for compatibility with external # Pass third_party as 'pkgs' (for compatibility with external

View file

@ -12,6 +12,7 @@
, externalArgs ? { } , externalArgs ? { }
, depotOverlays ? true , depotOverlays ? true
, localSystem ? externalArgs.localSystem or builtins.currentSystem , localSystem ? externalArgs.localSystem or builtins.currentSystem
, crossSystem ? externalArgs.crossSystem or localSystem
, ... , ...
}: }:
@ -31,7 +32,7 @@ let
checkMeta = false; checkMeta = false;
}; };
inherit localSystem; inherit localSystem crossSystem;
}; };
# import the nixos-unstable package set, or optionally use the # import the nixos-unstable package set, or optionally use the