Skip to content

Commit

Permalink
flake: Ignore broken packages for checks and hyrda
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzleutgeb committed Aug 24, 2023
1 parent 0893452 commit a0d4d94
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
12 changes: 10 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,29 @@
linuxSystem = "x86_64-linux";
pkgs = importNixpkgs linuxSystem [self.overlays.default];
treefmtEval = loadTreefmt pkgs;

# A function that removes packages that are known to
# have issues from a set of packages.
# Packages that are known to have issues, and should not
# be built by `nix flake check` or Hydra.
# Mark every entry with a GitHub issue that tracks
# respective issues.
filterBroken = nixpkgs.lib.filterAttrs (_: x: !x.meta.broken);
in {
# Github Actions executes `nix flake check` therefore this output
# should only contain derivations that can built within CI.
# See `.github/workflows/ci.yaml`.
checks.${linuxSystem} =
# For `nix flake check` to *build* all packages, because by default
# `nix flake check` only evaluates packages and does not build them.
self.packages.${linuxSystem}
(filterBroken self.packages.${linuxSystem})
// {
formatting = treefmtEval.config.build.check self;
};

# To generate a Hydra jobset for CI builds of all packages.
# See <https://hydra.ngi0.nixos.org/jobset/ngipkgs/main>.
hydraJobs.packages.${linuxSystem} = self.packages.${linuxSystem};
hydraJobs.packages.${linuxSystem} = (filterBroken self.packages.${linuxSystem});

# `nixosTests` is a non-standard name for a flake output.
# See <https://github.com/ngi-nix/ngipkgs/issues/28>.
Expand Down
2 changes: 2 additions & 0 deletions pkgs/liberaforms/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ in
shutdownPostgres
'';

meta.broken = true; # See <https://github.com/ngi-nix/ngipkgs/issues/40>.
}
11 changes: 10 additions & 1 deletion pkgs/liberaforms/env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,13 @@
${extraReq}
'';
in
mach-nix.mkPython {inherit requirements;}
(mach-nix.mkPython {
inherit requirements;
}).overrideAttrs (_: {
# NOTE: Probably this override could also be
# done via the `_` argument for `mach-nix.mkPython`,
# see <https://github.com/DavHau/mach-nix/tree/725aab8d52eb2f5b8ff67bea61049011ef31597c#optional-arguments>,
# but this works too, and we do not have to think about
# what `{package}` means.
meta.broken = true; # See <https://github.com/ngi-nix/ngipkgs/issues/40>.
})

0 comments on commit a0d4d94

Please sign in to comment.