| 1 | { self, lib, ... }: |
| 2 | { |
| 3 | # Group machine toplevels by architecture so CI can build all hosts of one |
| 4 | # arch in a single nix-fast-build invocation (the ofborg fleet in particular |
| 5 | # shares almost its entire closure). Hosts are listed explicitly to avoid |
| 6 | # forcing evaluation of every configuration just to learn its system. |
| 7 | flake.ciSystems = |
| 8 | let |
| 9 | nixos = names: lib.genAttrs names (n: self.nixosConfigurations."${n}".config.system.build.toplevel); |
| 10 | darwin = |
| 11 | names: lib.genAttrs names (n: self.darwinConfigurations."${n}".config.system.build.toplevel); |
| 12 | in |
| 13 | { |
| 14 | ofborg-x86_64-linux = nixos [ |
| 15 | "core01.ofborg.org" |
| 16 | "build01.ofborg.org" |
| 17 | "build02.ofborg.org" |
| 18 | "build03.ofborg.org" |
| 19 | "build04.ofborg.org" |
| 20 | ]; |
| 21 | ofborg-aarch64-linux = nixos [ |
| 22 | "eval01.ofborg.org" |
| 23 | "eval02.ofborg.org" |
| 24 | "eval03.ofborg.org" |
| 25 | "eval04.ofborg.org" |
| 26 | "build05.ofborg.org" |
| 27 | ]; |
| 28 | ofborg-aarch64-darwin = darwin [ |
| 29 | "nixos-foundation-macstadium-44911207" |
| 30 | "nixos-foundation-macstadium-44911104" |
| 31 | ]; |
| 32 | ofborg-x86_64-darwin = darwin [ |
| 33 | "nixos-foundation-macstadium-44911305" |
| 34 | "nixos-foundation-macstadium-44911362" |
| 35 | "nixos-foundation-macstadium-44911507" |
| 36 | ]; |
| 37 | }; |
| 38 | |
| 39 | perSystem = |
| 40 | { self', lib, ... }: |
| 41 | { |
| 42 | checks = |
| 43 | let |
| 44 | # TODO: our CI doesn't have a enough space for these just now |
| 45 | #nixosMachines = lib.mapAttrs' ( |
| 46 | # name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel |
| 47 | #) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); |
| 48 | nixosMachines = { }; |
| 49 | |
| 50 | packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages; |
| 51 | devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells; |
| 52 | in |
| 53 | nixosMachines // packages // devShells; |
| 54 | }; |
| 55 | } |