summaryrefslogtreecommitdiff
path: root/dev/ci.nix
blob: 48ca6d1b2802197b776c1f910112e05ae0e1f900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  lib,
  self,
  ...
}: {
  flake.hydraJobs = let
    ciSystems = ["x86_64-linux" "x86_64-darwin"];
    getOutputs = lib.getAttrs ciSystems;
  in
    lib.attrsets.mergeAttrsList [
      {
        checks = getOutputs self.checks;
        devShells = getOutputs self.devShells;
        homeConfigurations = lib.mapAttrs (_: v:
          lib.mapAttrs (_: v: v.activationPackage) v.homeConfigurations)
        (getOutputs self.legacyPackages);
      }

      (
        let
          toDerivs = lib.mapAttrs (_: configuration: configuration.config.system.build.toplevel);
          toCompatible = lib.filterAttrs (_: configuration: lib.elem configuration.pkgs.system ciSystems);
          getConfigurationsFor = type: toDerivs (toCompatible self.${type});

          configurations = [
            "nixosConfigurations"
            "darwinConfigurations"
          ];
        in
          lib.genAttrs configurations getConfigurationsFor
      )
    ];
}