Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / test / top-level / default.nix
blobfdb9fe09a88b86d567fa2a5c9a736dab95d0addf
1 { lib, pkgs, ... }:
2 let
3   nixpkgsFun = import ../../top-level;
4 in
5 lib.recurseIntoAttrs {
6   platformEquality =
7     let
8       configsLocal = [
9         # crossSystem is implicitly set to localSystem.
10         {
11           localSystem = { system = "x86_64-linux"; };
12         }
13         {
14           localSystem = { system = "aarch64-linux"; };
15           crossSystem = null;
16         }
17         # Both systems explicitly set to the same string.
18         {
19           localSystem = { system = "x86_64-linux"; };
20           crossSystem = { system = "x86_64-linux"; };
21         }
22         # Vendor and ABI inferred from system double.
23         {
24           localSystem = { system = "aarch64-linux"; };
25           crossSystem = { config = "aarch64-unknown-linux-gnu"; };
26         }
27       ];
28       configsCross = [
29         # GNU is inferred from double, but config explicitly requests musl.
30         {
31           localSystem = { system = "aarch64-linux"; };
32           crossSystem = { config = "aarch64-unknown-linux-musl"; };
33         }
34         # Cross-compile from AArch64 to x86-64.
35         {
36           localSystem = { system = "aarch64-linux"; };
37           crossSystem = { system = "x86_64-unknown-linux-gnu"; };
38         }
39       ];
41       pkgsLocal = map nixpkgsFun configsLocal;
42       pkgsCross = map nixpkgsFun configsCross;
43     in
44     assert lib.all (p: p.buildPlatform == p.hostPlatform) pkgsLocal;
45     assert lib.all (p: p.buildPlatform != p.hostPlatform) pkgsCross;
46     pkgs.emptyFile;