summaryrefslogtreecommitdiff
path: root/nix/ci.nix
blob: 38293ce7ff5134e32a7ba3e458bbb8c8dbe396c3 (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
{
  perSystem = {
    pkgs,
    lib,
    config,
    ...
  }: {
    /*
    require packages, checks, and devShells for ci to be considered a success

    also thanks DetSys for showing me i don't need to use runCommand, symlinkJoin, or linkFarm!
    https://determinate.systems/posts/hydra-deployment-source-of-truth
    */

    packages.ciGate = pkgs.writeText "ci-gate" ''
      ${
        lib.concatMapStringsSep "\n" (s: toString (builtins.attrValues s)) [
          config.checks
          config.devShells
          (builtins.removeAttrs config.packages ["default" "ciGate"])
        ]
      }
    '';
  };
}