diff options
Diffstat (limited to 'flake')
| -rw-r--r-- | flake/ci.nix | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/flake/ci.nix b/flake/ci.nix index cd1857f..e8a1373 100644 --- a/flake/ci.nix +++ b/flake/ci.nix @@ -1,4 +1,5 @@ { + config, lib, withSystem, self, @@ -41,32 +42,39 @@ }; }; - flake = { - hydraJobs = + flake.hydraJobs = - let - # Architecture of "main" CI machine - ciSystem = "x86_64-linux"; + let + # Architecture of "main" CI machine + ciSystem = "x86_64-linux"; - derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage; - mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg); - in + derivFromCfg = deriv: deriv.config.system.build.toplevel or deriv.activationPackage; + mapCfgsToDerivs = lib.mapAttrs (lib.const derivFromCfg); + in - withSystem ciSystem ( - { pkgs, self', ... }: + lib.genAttrs config.systems ( + lib.flip withSystem ( + { + system, + self', + ... + }: + + let + mapCfgsForSystem = + cfgs: lib.filterAttrs (lib.const (deriv: deriv.system == system)) (mapCfgsToDerivs cfgs); + in { - # I don't care to run these for each system, as they should be the same - # and don't need to be cached + darwinConfigurations = mapCfgsForSystem self.darwinConfigurations; + homeConfigurations = mapCfgsForSystem self.homeConfigurations; + nixosConfigurations = mapCfgsForSystem self.nixosConfigurations; + } + # I don't care to run these for each system, as they should be the same + # and don't need to be cached + // lib.optionalAttrs (system == ciSystem) { inherit (self') checks devShells; - - darwinConfigurations = mapCfgsToDerivs self.darwinConfigurations; - homeConfigurations = mapCfgsToDerivs self.homeConfigurations; - nixosConfigurations = mapCfgsToDerivs self.nixosConfigurations // { - # please add aarch64 runners github...please... - atlas = lib.deepSeq (derivFromCfg self.nixosConfigurations.atlas).drvPath pkgs.emptyFile; - }; } - ); - }; + ) + ); } |
