From 09e39ebbb7ccc2d11b641e70292c6ac28428f92a Mon Sep 17 00:00:00 2001 From: Qyriad Date: Mon, 6 May 2024 22:54:18 -0600 Subject: [PATCH] flake: fix eval of checks & devshell on i686-linux Change-Id: I62da3161327051005e3f48f83974140efef4417e --- flake.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 6594961ff..57b104483 100644 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,9 @@ ]; forAllSystems = lib.genAttrs systems; + # Same as forAllSystems, but removes nulls, in case something is broken + # on that system. + forAvailableSystems = f: lib.filterAttrs (name: value: value != null) (forAllSystems f); forAllCrossSystems = lib.genAttrs crossSystems; @@ -282,12 +285,15 @@ ); }; - pre-commit = forAllSystems ( + pre-commit = forAvailableSystems ( system: let pkgs = nixpkgsFor.${system}.native; + pre-commit-check = import ./misc/pre-commit.nix { inherit self pkgs pre-commit-hooks; }; + # dotnet-sdk_6, a nativeBuildInputs of pre-commit, is broken on i686-linux. + available = lib.meta.availableOn system pkgs.dotnet-sdk_6; in - import ./misc/pre-commit.nix { inherit self pkgs pre-commit-hooks; } + lib.optionalAttrs available pre-commit-check ); };