Skip to content

Commit

Permalink
flake: only build packages if they are available
Browse files Browse the repository at this point in the history
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
  • Loading branch information
Scrumplex committed Dec 6, 2024
1 parent 2f1c3d8 commit 4d0cbfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions parts/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
{ lib, ... }:
{
perSystem =
{ config, ... }:
{ config, pkgs, ... }:
let
inherit (lib) filterAttrs mapAttrs' nameValuePair;

packages' = filterAttrs (_: pkg: !pkg.meta.broken) config.packages;
packages' = filterAttrs (
_: pkg: !pkg.meta.broken && (lib.meta.availableOn pkgs.stdenv.hostPlatform pkg)
) config.packages;

packageChecks = mapAttrs' (n: nameValuePair "package-${n}") packages';
devShellChecks = mapAttrs' (n: nameValuePair "devShell-${n}") config.devShells;
Expand Down

0 comments on commit 4d0cbfb

Please sign in to comment.