diff --git a/flake.nix b/flake.nix index 99b8cd0..1e96a9b 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,30 @@ } ); + checks = forAllSystems ( + { pkgs }: + { + gdformat = pkgs.stdenvNoCC.mkDerivation { + name = "gdformat-check"; + src = pkgs.lib.sources.sourceFilesBySuffices (pkgs.lib.cleanSource ./.) [ ".gd" ]; + + nativeBuildInputs = with pkgs; [ + gdtoolkit_4 + ]; + + dontBuild = true; + doCheck = true; + + checkPhase = '' + export HOME=$(mktemp -d) + find . -name "*.gd" -print0 | xargs -0 gdformat --check + echo "All .gd files are properly formatted" + ''; + installPhase = "mkdir $out"; + }; + } + ); + packages = forAllSystems ( { pkgs }: let